Download presentation
Presentation is loading. Please wait.
Published byЭдуард Назарьев Modified over 5 years ago
1
Экспресс-погружение в разработку приложений на JavaScript
5/5/2019 Экспресс-погружение в разработку приложений на JavaScript // Константин Кичинский // Эксперт по стратегическим технологиям © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
2
О чем этот курс Развитие JavaScript Разработка приложений Перспективы
3
1. JavaScript
4
1.1 ECMAScript 6
5
Эволюция JS Первая версия – 1997г. ES2 – 1998г. ES3 – 1999г.
ES4 – “Harmony” ES5 – декабрь 2009г. V5.1 – июнь 2011г. (перевод) ES6 ~ середина 2015г.
7
ES5 var Civilian = function Civilian(name) { this.name = name; };
Civilian.prototype.danger = function () { console.log("Run away!");
8
ES5 var Civilian = function Civilian(name) { this.name = name; };
Civilian.prototype.danger = function () { console.log("Run away!"); var SuperHero = function (name, ability) { // Call the super class constructor. Civilian.call(this, name); this.ability = ability; SuperHero.prototype = Object.create(Civilian.prototype); SuperHero.prototype.constructor = SuperHero; // Override the super class method. SuperHero.prototype.danger = function () { console.log("Never fear, " + this.name + " is here!"); console.log(this.name + " uses " + this.ability + ". It's super effective.");
9
ES6. Классы class Civilian { constructor(name) { this.name = name; }
danger() { console.log("Run away!"); }; var SuperHero = function (name, ability) { // Call the super class constructor. Civilian.call(this, name); this.ability = ability; SuperHero.prototype = Object.create(Civilian.prototype); SuperHero.prototype.constructor = SuperHero; // Override the super class method. SuperHero.prototype.danger = function () { console.log("Never fear, " + this.name + " is here!"); console.log(this.name + " uses " + this.ability + ". It's super effective.");
10
ES6. Классы class Civilian { constructor(name) { this.name = name; }
danger() { console.log("Run away!"); }; class SuperHero extends Civilian { constructor(name, ability) { super(name); // Call the super class constructor this.ability = ability; // Override the super class method console.log("Never fear, " + this.name + " is here!"); console.log(this.name + " uses " + this.ability + ". It's super effective.");
11
ES6. Стрелочные функции // Expression bodies
var odds = evens.map(v => v + 1); var nums = evens.map((v, i) => v + i); // Statement bodies nums.forEach(v => { if (v % 5 === 0) fives.push(v); }); // Lexical this var bob = { _name: "Bob", _friends: [], printFriends() { this._friends.forEach(f => console.log(this._name + " knows " + f)); }
12
ES6. Параметры функций function f(x, y=12) {
// y is 12 if not passed (or passed as undefined) return x + y; } f(3) == 15 function f(x, ...y) { // y is an Array return x * y.length; f(3, "hello", true) == 6 function f(x, y, z) { return x + y + z; // Pass each elem of array as argument f(...[1,2,3]) == 6
13
ES6. Модули // lib/math.js export function sum(x, y) { return x + y; }
export var pi = ; // app.js module math from "lib/math"; alert("2π = " + math.sum(math.pi, math.pi)); // otherApp.js import {sum, pi} from "lib/math"; alert("2π = " + sum(pi, pi));
14
ES6. Обещания function timeout(duration = 0) {
return new Promise((resolve, reject) => { setTimeout(resolve, duration); }) } var p = timeout(1000).then(() => { return timeout(2000); }).then(() => { throw new Error("hmm"); }).catch(err => { return Promise.all([timeout(100), timeout(200)]);
15
ECMAScript 6 (ES6 Harmony)
Классы и модули Итераторы и генераторы Коллекции, Шаблоны Прокси Типизированные массивы Упрощение синтаксиса …
16
Windows Insider Program:
17
NEXT 1.2 TypeScript
18
Константин Кичинский Спасибо! Twitter: @kichinsky
Facebook:
19
5/5/2019 5:52 AM © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.