SlideShare a Scribd company logo
1 of 15
ECMAScript 5: Новое в JavaScript Юрій Чайковський [email_address]
Syntax ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arrays ,[object Object],[object Object],[object Object],[object Object]
JSON ,[object Object],[object Object],[object Object],[object Object]
Strict mode ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objects: Point function  Point(x, y) {   this .x = +x;    this .y = +y;  } var  pt =  new  Point(3,5); pt.x = 'foo';
Objects: Creating Object.create( p ,{ ( n : attrs )* })      .defineProperty( o , n , attrs )   .defineProperties( o ,{ ( n : attrs )* })   .getOwnPropertyNames( o )  ->   names   .getOwnPropertyDescriptor( o , n )  ->   attrs attrs  ::= {  value: v ,    writable: b ,         enumerable: b ,    configurable: b   } |   { get: f()->v ,  set: f(v) ,       enumerable: b ,   configurable: b  }
Objects: New Point function  Point(x, y) {   return   Object.freeze ({   x: +x,   y: +y   }); } // (new Point(3,4)  instanceof  Point) === false
Objects: New Point function  Point(x, y) {   return   Object.freeze ({   x: +x,   y: +y   }); } // (new Point(3,4)  instanceof  Point) === false function  Point(x, y) {   return  Object.freeze(   Object.create (Point.prototype, {   x: { value: +x, enumerable: true },   y: { value: +y, enumerable: true }   })); }
Objects: Accessor (getter/setter)  Old school... var  evnt = ( function (){ var  eventType = " barcamp "; return  { type :  function (tp){ if (typeof tp != " undefined "){ //setter... eventType = tp; }else{ //getter... return  eventType; } } }; })();
Objects: Creating Object.create( p ,{ ( n : attrs )* })      .defineProperty( o , n , attrs )   .defineProperties( o ,{ ( n : attrs )* })   .getOwnPropertyNames( o )  ->   names   .getOwnPropertyDescriptor( o , n )  ->   attrs attrs  ::= { value: v ,    writable: b ,         enumerable: b ,    configurable: b  } |   {  get: f()->v ,  set: f(v) ,       enumerable: b ,   configurable: b   }
Objects: Accessor (getter/setter)  Brand new... var  evnt = { eventType : "barcamp", get  type(){ //getter... return  evnt.eventType; }, set  type(tp){ //setter... evnt.eventType = tp; } };
Objects: Accessor (getter/setter)  or... var  evnt = Object.defineProperties({},   {  'typeName' : { value : "barcamp",  },   'type' : {   get : function() { return …; },   set : function(tp) { … },  } });
Objects:  Restrictions   ,[object Object],[object Object],[object Object]
References ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

What's hot (20)

Un dsl pour ma base de données
Un dsl pour ma base de donnéesUn dsl pour ma base de données
Un dsl pour ma base de données
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
gd
gdgd
gd
 
Typelevel summit
Typelevel summitTypelevel summit
Typelevel summit
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
Finch + Finagle OAuth2
Finch + Finagle OAuth2Finch + Finagle OAuth2
Finch + Finagle OAuth2
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
 
20151224-games
20151224-games20151224-games
20151224-games
 
Herding types with Scala macros
Herding types with Scala macrosHerding types with Scala macros
Herding types with Scala macros
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
F(2)
F(2)F(2)
F(2)
 
ts
tsts
ts
 
サイ本 文
サイ本 文サイ本 文
サイ本 文
 
A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
 
Ray Tracing with ZIO
Ray Tracing with ZIORay Tracing with ZIO
Ray Tracing with ZIO
 
Data Structures Practical File
Data Structures Practical File Data Structures Practical File
Data Structures Practical File
 
Reactive x
Reactive xReactive x
Reactive x
 
Sol10
Sol10Sol10
Sol10
 
Ray tracing with ZIO-ZLayer
Ray tracing with ZIO-ZLayerRay tracing with ZIO-ZLayer
Ray tracing with ZIO-ZLayer
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 

Similar to ECMAScript 5: Новое в JavaScript

Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montage
Kris Kowal
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
Dmitry Soshnikov
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developers
Stoyan Stefanov
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
Seri Moth
 
AST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScript
Ingvar Stepanyan
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
偉格 高
 

Similar to ECMAScript 5: Новое в JavaScript (20)

Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montage
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
Proxies are Awesome!
Proxies are Awesome!Proxies are Awesome!
Proxies are Awesome!
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developers
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
 
OO in JavaScript
OO in JavaScriptOO in JavaScript
OO in JavaScript
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
 
Java Script Workshop
Java Script WorkshopJava Script Workshop
Java Script Workshop
 
JSConf: All You Can Leet
JSConf: All You Can LeetJSConf: All You Can Leet
JSConf: All You Can Leet
 
Php sql-android
Php sql-androidPhp sql-android
Php sql-android
 
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET ApplicationTips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET Application
 
ITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function Programming
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
 
AST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScript
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
Object-oriented Javascript
Object-oriented JavascriptObject-oriented Javascript
Object-oriented Javascript
 
JQuery Presentation
JQuery PresentationJQuery Presentation
JQuery Presentation
 

More from Департамент Стратегических Технологий

More from Департамент Стратегических Технологий (20)

Microsoft SWIT 2012 in Kyiv, Ukraine
Microsoft SWIT 2012 in Kyiv, UkraineMicrosoft SWIT 2012 in Kyiv, Ukraine
Microsoft SWIT 2012 in Kyiv, Ukraine
 
JavaScript как объектно-ориентированный язык программирования
JavaScript как объектно-ориентированный язык программированияJavaScript как объектно-ориентированный язык программирования
JavaScript как объектно-ориентированный язык программирования
 
HTML for smart TV
HTML for smart TVHTML for smart TV
HTML for smart TV
 
Semantic Grid. Layout of the future
Semantic Grid. Layout of the futureSemantic Grid. Layout of the future
Semantic Grid. Layout of the future
 
Progressive Enhancement
Progressive EnhancementProgressive Enhancement
Progressive Enhancement
 
Hard Rock Design
Hard Rock DesignHard Rock Design
Hard Rock Design
 
Способы структурирования данных и виды навигации сложных сайтов СМИ
Способы структурирования данных и виды навигации сложных сайтов СМИСпособы структурирования данных и виды навигации сложных сайтов СМИ
Способы структурирования данных и виды навигации сложных сайтов СМИ
 
CSS3 Animations
CSS3 AnimationsCSS3 Animations
CSS3 Animations
 
Responsive Web design. Что это и как использовать
Responsive Web design. Что это и как использоватьResponsive Web design. Что это и как использовать
Responsive Web design. Что это и как использовать
 
Инфографика
ИнфографикаИнфографика
Инфографика
 
Проектирование Интерфейсов
Проектирование ИнтерфейсовПроектирование Интерфейсов
Проектирование Интерфейсов
 
Разработка SaaS решений на платформе Windows Azure, Azure University
Разработка SaaS решений на платформе Windows Azure, Azure UniversityРазработка SaaS решений на платформе Windows Azure, Azure University
Разработка SaaS решений на платформе Windows Azure, Azure University
 
Архитектура облачных приложений. Типовые шаблоны, Azure University
Архитектура облачных приложений. Типовые шаблоны, Azure UniversityАрхитектура облачных приложений. Типовые шаблоны, Azure University
Архитектура облачных приложений. Типовые шаблоны, Azure University
 
Технический обзор платформы Windows Azure. Демонстрация, Azure University
Технический обзор платформы Windows Azure. Демонстрация, Azure UniversityТехнический обзор платформы Windows Azure. Демонстрация, Azure University
Технический обзор платформы Windows Azure. Демонстрация, Azure University
 
Сценарии применения Windows Azure, Azure University
Сценарии применения Windows Azure, Azure UniversityСценарии применения Windows Azure, Azure University
Сценарии применения Windows Azure, Azure University
 
Облачные сервисы Майкрософт и возможности для партнеров, Azure University
Облачные сервисы Майкрософт и возможности для партнеров, Azure UniversityОблачные сервисы Майкрософт и возможности для партнеров, Azure University
Облачные сервисы Майкрософт и возможности для партнеров, Azure University
 
Что нового в CSS3
Что нового в CSS3Что нового в CSS3
Что нового в CSS3
 
Обзор IE9 developer tools
Обзор IE9 developer toolsОбзор IE9 developer tools
Обзор IE9 developer tools
 
Pinned Sites
Pinned SitesPinned Sites
Pinned Sites
 
Карта Потребностей
Карта ПотребностейКарта Потребностей
Карта Потребностей
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

ECMAScript 5: Новое в JavaScript

  • 1. ECMAScript 5: Новое в JavaScript Юрій Чайковський [email_address]
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Objects: Point function Point(x, y) {   this .x = +x; this .y = +y; } var pt = new Point(3,5); pt.x = 'foo';
  • 7. Objects: Creating Object.create( p ,{ ( n : attrs )* })   .defineProperty( o , n , attrs ) .defineProperties( o ,{ ( n : attrs )* }) .getOwnPropertyNames( o ) -> names .getOwnPropertyDescriptor( o , n ) -> attrs attrs ::= { value: v , writable: b ,       enumerable: b , configurable: b } | { get: f()->v , set: f(v) ,      enumerable: b , configurable: b }
  • 8. Objects: New Point function Point(x, y) { return Object.freeze ({ x: +x, y: +y }); } // (new Point(3,4) instanceof Point) === false
  • 9. Objects: New Point function Point(x, y) { return Object.freeze ({ x: +x, y: +y }); } // (new Point(3,4) instanceof Point) === false function Point(x, y) { return Object.freeze( Object.create (Point.prototype, { x: { value: +x, enumerable: true }, y: { value: +y, enumerable: true } })); }
  • 10. Objects: Accessor (getter/setter) Old school... var evnt = ( function (){ var eventType = " barcamp "; return { type : function (tp){ if (typeof tp != " undefined "){ //setter... eventType = tp; }else{ //getter... return eventType; } } }; })();
  • 11. Objects: Creating Object.create( p ,{ ( n : attrs )* })   .defineProperty( o , n , attrs ) .defineProperties( o ,{ ( n : attrs )* }) .getOwnPropertyNames( o ) -> names .getOwnPropertyDescriptor( o , n ) -> attrs attrs ::= { value: v , writable: b ,       enumerable: b , configurable: b } | { get: f()->v , set: f(v) ,      enumerable: b , configurable: b }
  • 12. Objects: Accessor (getter/setter) Brand new... var evnt = { eventType : "barcamp", get type(){ //getter... return evnt.eventType; }, set type(tp){ //setter... evnt.eventType = tp; } };
  • 13. Objects: Accessor (getter/setter) or... var evnt = Object.defineProperties({}, { 'typeName' : { value : "barcamp", }, 'type' : { get : function() { return …; }, set : function(tp) { … }, } });
  • 14.
  • 15.