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

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

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.