Skip to content

Instantly share code, notes, and snippets.

View vjefri's full-sized avatar

Jefri Vanegas vjefri

View GitHub Profile
/* ES6 the Lazy Way */
var nums = [1, 2, 3, 4, 5, 6]
// You don't have to use braces when it is a simple expression
// No need to say return, it just knows
// The fat arrow is creating the function
// If we have one arg, no need to add parens
var odds = nums.map(v => v + 1); // [ 2, 3, 4, 5, 6, 7 ]