Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Functional Programming - workshop

Functional Programming - workshop

Alex Canessa

June 20, 2016
Tweet

More Decks by Alex Canessa

Other Decks in Programming

Transcript

  1. @alexcanessa functional programming Mutable and Immutable Strings: var str =

    ‘alex’; str.slice(0, 2); // ‘al’ str; // ‘alex’ // N.B. str += ‘ canessa’; // ‘alexcanessa’ // the value ‘alex’ didn’t change!
  2. @alexcanessa functional programming Mutable and Immutable Numbers: // Imaging an

    environment where 2 + 5 // Changes the value 2 // AH!
  3. @alexcanessa functional programming Converting to ES6 The Arrow function, returns

    [1, 2, 3].map(function (number) { return number + 2; }); [1, 2, 3].map(number => number + 2);