Author: Not specified Language: javascript
Description: Not specified Timestamp: 2018-04-17 08:36:29 +0000
View raw paste Reply
  1. var sample = [1, 2, 3] // i am never gonna change Boo! Yeah
  2. // es5
  3. var mapped = sample.map(function(elem) {
  4.     return elem * 10;
  5. })
  6. // es6
  7. let mapped = sample.map(elem => elem * 10)
  8. console.log(mapped);
  9. /* output */
  10. [10, 20, 30]
View raw paste Reply