Arrow Function
Arrow functions were introduced in the ES6 version.Arrow functions are anonymous functions i.e. 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.
Syntax:
const gfg = () => {
console.log( "Hi Geek!" );
}
Example: herecis the basic example of arrow function.
Javascript
const gfg = () => { console.log( "Hi from GeekforGeeks!" ); } gfg(); |
Output
Hi from GeekforGeeks!
JS 2015 or ECMAScript 6 (ES6)
JS 2015 (ES6) also known as ECMAScript 6 (ES6), ECMAScript 6 (ES6) is a significant update to JavaScript, introducing arrow functions, classes, template literals, let and const for variable declaration, enhanced object literals, destructuring, and more modern features for better code organization and readability.
Contact Us