Created
April 16, 2021 11:01
-
-
Save jasdeep06/6e021f22d1ef59d97da135957c2d116c to your computer and use it in GitHub Desktop.
This file contains 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
//simple function(named) | |
function hello(name){ | |
console.log("Hello",name) | |
} | |
//expression function | |
const hello = function(name){ | |
console.log("Hello",name) | |
} | |
//arrow function | |
const hello = (name) => { | |
console.log("Hello",name) | |
} | |
//arrow function with syntactic sugar of not including braces in arguments if it has only one argument | |
const hello = name => { | |
console.log("Hello",name) | |
} | |
//arrow function with syntactic sugar of excluding braces if function has only a single expression | |
const hello = name => console.log("Hello",name) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment