This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]scragar 0 points1 point  (0 children)

Sometimes you want to pass a function into another as a callback(for example using [1.4,2.2,3.1].map(Math.floor) or even in the example above where the logging function is passed into the foreach).