es2015 workflows

48
ECMAScript 2015 @jsoverson

Upload: jarrod-overson

Post on 16-Aug-2015

251 views

Category:

Technology


1 download

TRANSCRIPT

  1. 1. ECMAScript 2015 @jsoverson
  2. 2. var that = this;
  3. 3. function Klass() { }
  4. 4. function Klass() { } Klass.prototype.myMethod = function(){}
  5. 5. function Klass() { } Klass.prototype = Parent.prototype; Klass.prototype.myMethod = function(){}
  6. 6. Klass.prototype.myMethod() { console.log('In my Method!'); }
  7. 7. if (typeof exports === 'object' && typeof define !== 'function') { var define = function (factory) { factory(require, exports, module); }; } define(function (require, exports, module) { var b = require('b'); exports.action = function () {}; });
  8. 8. ES2015 to the rescue!
  9. 9. Me
  10. 10. 1. What is ES2015? 2. How can I use it? 3. Whats next?
  11. 11. ES2015 used to be known as ES6
  12. 12. You can play around here http://bit.ly/es6console
  13. 13. function (x) { return x * 2 } x => x * 2 Becomes
  14. 14. [1,2,3].map(x => x * 2) .reduce((p,n) => p + n)
  15. 15. { update : function(data) {/**/}, retrieve : function() { fetch('http://example.com') .then(res => this.update(res)) } }
  16. 16. function JavaScrap(name) { Person.call(this, name); this.shout('i