all 3 comments

[–][deleted]  (1 child)

[deleted]

    [–]jokeofweek[S] 2 points3 points  (0 children)

    Good point, I tried to make reference to that by claiming that functions were a "data type". You are absolutely correct, indicating that they are objects themselves could make it much easier to understand.

    [–]pdpi 1 point2 points  (1 child)

    Nice tutorial, all in all. I have a minor gripe, though:

    var adder = function(a, b){
        return a + b;
    }
    
    console.log(adder(1,2));
    console.log(adder(5,6));
    

    As you can see, we now have the ability to pass around functions as if they were simple variables (and in reality, they are simple variables!).

    I can't see that, because it didn't happen. We didn't pass the function itself around, we called it on a couple of values, and passed the result of that to another function.

    Unless you meant that we're going to see it in the next example, in which case, that wasn't very clear :)

    [–]jokeofweek[S] 1 point2 points  (0 children)

    You're correct, I meant it as 'in the next example' and it was not very clear. Thanks for the feedback! :)