Thursday, November 21, 2013

Passing a function as an argument

In class yesterday we learned about the reduce function. This function is a bit different from others that we've learned about because it takes a function as an argument. This is new, but I don't find it as intimidating as Danny said we might feel. I think it's actually pretty cool and it makes a lot of sense to me intuitively that a function name could be used as an argument. I think the reduce method is useful and after I use it a few times I'll be used to sending it a function.

No comments:

Post a Comment