November 2014
Beginner
336 pages
10h 58m
English
The body of a function is not executed until the function is invoked (or called). Function invocation looks much the same in most languages: the function’s name followed by a pair of parentheses. The parentheses might or might not have some arguments inside. To invoke the countToTen function, you simply use countToTen();. Give it a try in the console. You have invoked many a function already: console.log('Instruction 1'); is a function, as is phoneNumberPattern.exec(phoneNumber); (from prompt.js). These examples include arguments between the opening and closing parentheses (see the next section), but they are function invocations all the same.
Read now
Unlock full access