This document provides notes on JavaScript functions, detailing their purpose and how they are invoked. It explains the structure of a function and introduces arrow functions, highlighting their characteristics and limitations. An example of both a normal function and an arrow function for multiplication is included.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views1 page
Javascript Notes
This document provides notes on JavaScript functions, detailing their purpose and how they are invoked. It explains the structure of a function and introduces arrow functions, highlighting their characteristics and limitations. An example of both a normal function and an arrow function for multiplication is included.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
JAVASCRIPT NOTES
Functions A JavaScript function is a block of code designed to perform a particular task.
A JavaScript function is executed when "something" invokes it (calls it).
function name(parameter1, parameter2, parameter3) {
// code to be executed }
Example // Function to compute the product of p1 and p2 function myFunction(p1, p2) { return p1 * p2; }
Arrow functions are anonymous functions i.e. they are
functions without a name and are not bound by an identifier. Arrow functions do not return any value and can be declared without the function keyword. They are also called Lambda Functions. Arrow functions do not have the prototype property like this, arguments, or super. Arrow functions cannot be used with the new keyword. Arrow functions cannot be used as constructors. // Normal function for multiplication // of two numbers function multiply(a, b) { return a * b; } console.log(multiply(3, 5));
Below code uses Arrow function to perform the multiplication in