An arrow function expression (previously, and now incorrectly known as fat arrow function) has a shorter syntax compared to function expressions. Arrow functions are always anonymous.
Arrow Function
- Do not call before definition
- An arrow function cannot contain a line break between its parameters and its arrow.
Arrow Function With Parameter
•With one Parameter
Syntax: (para) => {statement};
Syntax: para => {statement};
•More than one Parameter
Syntax: (para1, para2, paraN) => {statement};
•No Parameter
Syntax: ( ) => {statement};
Arrow Function with Parameter
•Default Parameter
Syntax: (para1, para2 = value) => {statement};
•Rest Parameter
Syntax: (para1, …args) => {statement};
Latest posts by rajeshkumar (see all)
- AWS Error: Access denied by EC2 Instance Connect - December 4, 2023
- How to get Blackduck Trial version? - December 3, 2023
- PHP ionCube Error: cannot be decoded by this version of the ionCube Loader - December 2, 2023