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