Created
August 16, 2023 15:33
-
-
Save suhailgupta03/043d4959744fa534f6e51d70c0db5581 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link to second example: https://gist.github.com/suhailgupta03/f51882f4c00a01752e4c14efe88a6cfd