Higher-order function as argument

Write apply(value, fn) that calls fn with value and returns whatever it produces.
JavaScript
Console