Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created August 16, 2023 15:33
Show Gist options
  • Save suhailgupta03/043d4959744fa534f6e51d70c0db5581 to your computer and use it in GitHub Desktop.
Save suhailgupta03/043d4959744fa534f6e51d70c0db5581 to your computer and use it in GitHub Desktop.
// ES6
// ES6 means ECMAScript 6, which is the latest version of JavaScript.
// ECMAScript is the organization that sets the standards for JavaScript.
// The version before ES6 was ES5.
// ES5
let myFunction = function (a, b) {
return a * b;
}
console.log(myFunction(2, 3)); // 6
// ES6 using arrow functions
let myFunctionVersion2 = (a, b) => {
return a * b;
}
console.log(myFunctionVersion2(2, 3)); // 6
@suhailgupta03
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment