Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript =>

// Javascript => is called Arrow Function: A short syntax for functions

hello1 = function(name) {
  return "Hello " + name + "!";
} // can be replaced with arrow function. See below.

hello2 = (name) => { return "Hello " + name + "!"; } // Arrow Function =>

hello3 = (name) => "Hello " + name + "!"; // Even shorter =>

console.log(hello1("Alice"), hello2("Bob"), hello3("Ada"))
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
4+3 =