Last active
January 19, 2019 23:13
-
-
Save Tombarr/071706d6e2faaf9ec6aacfb9c42c87a6 to your computer and use it in GitHub Desktop.
Simple named function in Javascript
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
function addTen(x) { | |
return x + 10; | |
} | |
// You can also assign an arrow functions to a variable | |
const addTen = (x) => x + 10; | |
addTen(10); // 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment