Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

es6 arrow function

//ES5
var phraseSplitterEs5 = function phraseSplitter(phrase) {
  return phrase.split(' ');
};

//ES6
const phraseSplitterEs6 = phrase => phrase.split(" ");

console.log(phraseSplitterEs6("ES6 Awesomeness"));  // ["ES6", "Awesomeness"]
Comment

es6 arrow function

const multiplyES6 = (x, y) => x * y;
Comment

es6 arrow function

// ES6
const prices = smartPhones.map(smartPhone => smartPhone.price);
console.log(prices); // [649, 576, 489]
Comment

javascript Arrow Function as an Expressio

let age = 5;

let welcome = (age < 18) ?
  () => console.log('Baby') :
  () => console.log('Adult');

welcome(); // Baby
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript Passing Parameter as Default Values 
Javascript :: reading an array from python to js 
Javascript :: javascript WeakMaps Are Not iterable 
Javascript :: javascript of the object properties to a single variable 
Javascript :: convert dom object to string 
Javascript :: javascript Undeclared variable is not allowed 
Javascript :: electron InitializeSandbox() called with multiple threads in process gpu-process. 
Javascript :: javascript function definitions 
Javascript :: actionscript random randomfunction 
Javascript :: React ES6 Variables 
Javascript :: nodjs : Stream for big file 
Javascript :: How to add pop-up confirmation in angular typescript. 
Javascript :: Create & Download PDF from Byte[] Array using jQuery AJAX 
Javascript :: window alert javascript css 
Javascript :: js file not show update 
Javascript :: phaser animation from png sequence 
Javascript :: phaser stagger play 2 
Javascript :: Exercice âge JavaScript 
Javascript :: Datatable js Search Server side after time or word length 
Javascript :: nextjs check path 404 
Javascript :: javascript list all elements in set 
Javascript :: react native geolocation 
Javascript :: javascript in jsx 
Javascript :: () = javascript 
Javascript :: change value in array react 
Javascript :: date pipe 
Javascript :: in js pass infinite argument in function 
Javascript :: mongoose update array push multiple 
Javascript :: javascript set header text 
Javascript :: js Destructuring in React 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =