Select Page

Javascript Custom Functions

// Functions are defined and called // This is a function definition: function calc() { //This is the function body console.log(‘Running Calculate!’); const total = 100 * 1.07;  //sales tax 7%, as an example return total; } //This is a function call...

Javascript Built in Functions

Example: Math.max is a built in function in javascript. Math.max(4, 10, 11, 15)    // returns 15, the highest of the numbers. 4,10,11,15 are called arguments.  Arguments are passed to a function. 15 is called the returned value console.log(‘Text’)  //...