SlideShare a Scribd company logo
Getting classy with ES6
Andy Sharman // @udjamaflip
A quick JavaScript history
It used to look like this...
<script>
function openWin() {
window.open("http://www.domain.com/myotherpage.html");
}
</script>
<input type="button" value="Open Window" onclick="openWin()">
...and that was a good start.
Then we started getting a bit
clever with JS
function UserManager(){
this.userDetails = {};
}
UserManager.prototype.setName = function( firstName, lastName ) {
return this.userDetails.name = firstName + ' ' + lastName;
};
var billy = new UserManager();
billy.setName('Billy', 'Smith');
console.log(billy);
output:
UserManager {userDetails: Object, setName:
function}
userDetails: Object
name: "Billy Smith"
__proto__: Object
__proto__: UserManager
Object-Orientated JS really
became popular
var Cat = new Class({});
- mootools
jQuery.extend( target [, object1 ] [, objectN ] )
- jQuery
var HelloWorld = angular.module("Demo", []);
HelloWorld.factory("FooBar", function() {});
- Angular
var HelloMessage = React.createClass({});
- React.js
But wasn’t quite as “elegant”
as other languages
ES6 made it classy
Classes with inheritance: class UserManager extends Users {
ES6 made it classy
Classes with inheritance: class UserManager extends Users {
Constructors: constructor() {
ES6 made it classy
Classes with inheritance: class UserManager extends Users {
Constructors: constructor() {
Getters/Setters: get name() {
ES6 made it classy
Classes with inheritance: class UserManager extends Users {
Constructors: constructor() {
Getters/Setters: get name() {
Rest params: myMethod(...name) {
ES6 made it classy
Classes with inheritance: class UserManager extends Users {
Constructors: constructor() {
Getters/Setters: get name() {
Rest params: myMethod(...name) {
Default param values: myMethod(foo = 'my default string') {
ES6 made it classy
Classes with inheritance: class UserManager extends Users {
Constructors: constructor() {
Getters/Setters: get name() {
Rest params: myMethod(...name) {
Default param values: myMethod(foo = 'my default string') {
Arrow functions: document.addEventListener('DOMReady', (e) => {
This is the current support
ES6 Support table by Kangax
Yes, that was Microsoft Edge
leading the way
Traceur and Babel
Questions?
Andy Sharman // @udjamaflip

More Related Content

What's hot

Lecture 5: Client Side Programming 1
Lecture 5: Client Side Programming 1Lecture 5: Client Side Programming 1
Lecture 5: Client Side Programming 1
Artificial Intelligence Institute at UofSC
 
Growing jQuery
Growing jQueryGrowing jQuery
Growing jQuery
gueste8d8bc
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
Md. Ziaul Haq
 
Javascript session june 2013 (iii) jquery json
Javascript session june 2013 (iii) jquery   jsonJavascript session june 2013 (iii) jquery   json
Javascript session june 2013 (iii) jquery json
abksharma
 
Javascript - Beyond-jQuery
Javascript - Beyond-jQueryJavascript - Beyond-jQuery
MVVM e Caliburn Micro for Windows Phone applications
MVVM e Caliburn Micro for Windows Phone applicationsMVVM e Caliburn Micro for Windows Phone applications
MVVM e Caliburn Micro for Windows Phone applications
Matteo Pagani
 
AngulrJS Overview
AngulrJS OverviewAngulrJS Overview
AngulrJS Overview
Eyal Vardi
 
Rails GUI Development with Ext JS
Rails GUI Development with Ext JSRails GUI Development with Ext JS
Rails GUI Development with Ext JS
Martin Rehfeld
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event Handling
Yorick Phoenix
 
Special Events: Beyond Custom Events
Special Events: Beyond Custom EventsSpecial Events: Beyond Custom Events
Special Events: Beyond Custom Events
Brandon Aaron
 
FuncUnit
FuncUnitFuncUnit
FuncUnit
Brian Moschel
 
An intro to Backbone.js
An intro to Backbone.jsAn intro to Backbone.js
An intro to Backbone.js
tonydewan
 
Evented Javascript
Evented JavascriptEvented Javascript
Evented Javascript
waw325
 
JavaScript on the Desktop
JavaScript on the DesktopJavaScript on the Desktop
JavaScript on the Desktop
Domenic Denicola
 
Performances & SEO in AngularJS
Performances & SEO in AngularJSPerformances & SEO in AngularJS
Performances & SEO in AngularJS
Philos.io
 
Sins Against Drupal 2
Sins Against Drupal 2Sins Against Drupal 2
Sins Against Drupal 2
Aaron Crosman
 
handout-05b
handout-05bhandout-05b
handout-05b
tutorialsruby
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 
Sprout core and performance
Sprout core and performanceSprout core and performance
Sprout core and performance
Yehuda Katz
 
Drupal sins 2016 10-06
Drupal sins 2016 10-06Drupal sins 2016 10-06
Drupal sins 2016 10-06
Aaron Crosman
 

What's hot (20)

Lecture 5: Client Side Programming 1
Lecture 5: Client Side Programming 1Lecture 5: Client Side Programming 1
Lecture 5: Client Side Programming 1
 
Growing jQuery
Growing jQueryGrowing jQuery
Growing jQuery
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
Javascript session june 2013 (iii) jquery json
Javascript session june 2013 (iii) jquery   jsonJavascript session june 2013 (iii) jquery   json
Javascript session june 2013 (iii) jquery json
 
Javascript - Beyond-jQuery
Javascript - Beyond-jQueryJavascript - Beyond-jQuery
Javascript - Beyond-jQuery
 
MVVM e Caliburn Micro for Windows Phone applications
MVVM e Caliburn Micro for Windows Phone applicationsMVVM e Caliburn Micro for Windows Phone applications
MVVM e Caliburn Micro for Windows Phone applications
 
AngulrJS Overview
AngulrJS OverviewAngulrJS Overview
AngulrJS Overview
 
Rails GUI Development with Ext JS
Rails GUI Development with Ext JSRails GUI Development with Ext JS
Rails GUI Development with Ext JS
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event Handling
 
Special Events: Beyond Custom Events
Special Events: Beyond Custom EventsSpecial Events: Beyond Custom Events
Special Events: Beyond Custom Events
 
FuncUnit
FuncUnitFuncUnit
FuncUnit
 
An intro to Backbone.js
An intro to Backbone.jsAn intro to Backbone.js
An intro to Backbone.js
 
Evented Javascript
Evented JavascriptEvented Javascript
Evented Javascript
 
JavaScript on the Desktop
JavaScript on the DesktopJavaScript on the Desktop
JavaScript on the Desktop
 
Performances & SEO in AngularJS
Performances & SEO in AngularJSPerformances & SEO in AngularJS
Performances & SEO in AngularJS
 
Sins Against Drupal 2
Sins Against Drupal 2Sins Against Drupal 2
Sins Against Drupal 2
 
handout-05b
handout-05bhandout-05b
handout-05b
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
 
Sprout core and performance
Sprout core and performanceSprout core and performance
Sprout core and performance
 
Drupal sins 2016 10-06
Drupal sins 2016 10-06Drupal sins 2016 10-06
Drupal sins 2016 10-06
 

Viewers also liked

10 Useful New Features of ECMA Script 6
10 Useful New Features of ECMA Script 610 Useful New Features of ECMA Script 6
10 Useful New Features of ECMA Script 6
Lohith Goudagere Nagaraj
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new features
GephenSG
 
Say Hello To Ecmascript 5
Say Hello To Ecmascript 5Say Hello To Ecmascript 5
Say Hello To Ecmascript 5
Juriy Zaytsev
 
What is New in HTML5?
What is New in HTML5?What is New in HTML5?
What is New in HTML5?
Nitay Neeman
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
Nitay Neeman
 
LT#8 乗るしかないこのECMA Script 2015に
LT#8 乗るしかないこのECMA Script 2015にLT#8 乗るしかないこのECMA Script 2015に
LT#8 乗るしかないこのECMA Script 2015に
do7be
 
BabelJS - James Kyle at Modern Web UI
BabelJS - James Kyle at Modern Web UIBabelJS - James Kyle at Modern Web UI
BabelJS - James Kyle at Modern Web UI
modernweb
 
ES6: The future is now
ES6: The future is nowES6: The future is now
ES6: The future is now
Sebastiano Armeli
 
Testing React Applications
Testing React ApplicationsTesting React Applications
Testing React Applications
stbaechler
 
An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)
LearningTech
 
Immutability and immutable js
Immutability and immutable jsImmutability and immutable js
Immutability and immutable js
Marcelo Cure
 
Understanding ECMA Script 6 Javascript by Gaurav Khurana
Understanding ECMA Script 6 Javascript by Gaurav KhuranaUnderstanding ECMA Script 6 Javascript by Gaurav Khurana
Understanding ECMA Script 6 Javascript by Gaurav Khurana
Gaurav Khurana
 

Viewers also liked (12)

10 Useful New Features of ECMA Script 6
10 Useful New Features of ECMA Script 610 Useful New Features of ECMA Script 6
10 Useful New Features of ECMA Script 6
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new features
 
Say Hello To Ecmascript 5
Say Hello To Ecmascript 5Say Hello To Ecmascript 5
Say Hello To Ecmascript 5
 
What is New in HTML5?
What is New in HTML5?What is New in HTML5?
What is New in HTML5?
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
 
LT#8 乗るしかないこのECMA Script 2015に
LT#8 乗るしかないこのECMA Script 2015にLT#8 乗るしかないこのECMA Script 2015に
LT#8 乗るしかないこのECMA Script 2015に
 
BabelJS - James Kyle at Modern Web UI
BabelJS - James Kyle at Modern Web UIBabelJS - James Kyle at Modern Web UI
BabelJS - James Kyle at Modern Web UI
 
ES6: The future is now
ES6: The future is nowES6: The future is now
ES6: The future is now
 
Testing React Applications
Testing React ApplicationsTesting React Applications
Testing React Applications
 
An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)
 
Immutability and immutable js
Immutability and immutable jsImmutability and immutable js
Immutability and immutable js
 
Understanding ECMA Script 6 Javascript by Gaurav Khurana
Understanding ECMA Script 6 Javascript by Gaurav KhuranaUnderstanding ECMA Script 6 Javascript by Gaurav Khurana
Understanding ECMA Script 6 Javascript by Gaurav Khurana
 

Similar to Getting classy with ES6

Обзор автоматизации тестирования на JavaScript
Обзор автоматизации тестирования на JavaScriptОбзор автоматизации тестирования на JavaScript
Обзор автоматизации тестирования на JavaScript
COMAQA.BY
 
Week 4 - jQuery + Ajax
Week 4 - jQuery + AjaxWeek 4 - jQuery + Ajax
Week 4 - jQuery + Ajax
baygross
 
Webauthn Tutorial
Webauthn TutorialWebauthn Tutorial
Webauthn Tutorial
FIDO Alliance
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
Simon Willison
 
Java script+mvc+with+emberjs
Java script+mvc+with+emberjsJava script+mvc+with+emberjs
Java script+mvc+with+emberjs
ji guang
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
Anjan Banda
 
Javascript basics for automation testing
Javascript  basics for automation testingJavascript  basics for automation testing
Javascript basics for automation testing
Vikas Thange
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
Michael Girouard
 
Classing up ES6 - Web Directions code 2015 (1)
Classing up ES6 - Web Directions code 2015 (1)Classing up ES6 - Web Directions code 2015 (1)
Classing up ES6 - Web Directions code 2015 (1)
Andy Sharman
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
Jonathan Wage
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
rajivmordani
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
Luke Summerfield
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
Ting Lv
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
Doeun KOCH
 
Taming forms with React
Taming forms with ReactTaming forms with React
Taming forms with React
GreeceJS
 
Experience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - HighlightsExperience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - Highlights
Cédric Hüsler
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
AnamikaRai59
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
Nishan Subedi
 
Java script object model
Java script object modelJava script object model
Java script object model
James Hsieh
 
Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Introduction to ECMAScript 2015
Introduction to ECMAScript 2015
Tomasz Dziuda
 

Similar to Getting classy with ES6 (20)

Обзор автоматизации тестирования на JavaScript
Обзор автоматизации тестирования на JavaScriptОбзор автоматизации тестирования на JavaScript
Обзор автоматизации тестирования на JavaScript
 
Week 4 - jQuery + Ajax
Week 4 - jQuery + AjaxWeek 4 - jQuery + Ajax
Week 4 - jQuery + Ajax
 
Webauthn Tutorial
Webauthn TutorialWebauthn Tutorial
Webauthn Tutorial
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
 
Java script+mvc+with+emberjs
Java script+mvc+with+emberjsJava script+mvc+with+emberjs
Java script+mvc+with+emberjs
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
 
Javascript basics for automation testing
Javascript  basics for automation testingJavascript  basics for automation testing
Javascript basics for automation testing
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
Classing up ES6 - Web Directions code 2015 (1)
Classing up ES6 - Web Directions code 2015 (1)Classing up ES6 - Web Directions code 2015 (1)
Classing up ES6 - Web Directions code 2015 (1)
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
 
Taming forms with React
Taming forms with ReactTaming forms with React
Taming forms with React
 
Experience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - HighlightsExperience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - Highlights
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
Java script object model
Java script object modelJava script object model
Java script object model
 
Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Introduction to ECMAScript 2015
Introduction to ECMAScript 2015
 

Recently uploaded

Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 

Recently uploaded (20)

Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 

Getting classy with ES6

  • 1. Getting classy with ES6 Andy Sharman // @udjamaflip
  • 3. It used to look like this... <script> function openWin() { window.open("http://www.domain.com/myotherpage.html"); } </script> <input type="button" value="Open Window" onclick="openWin()">
  • 4. ...and that was a good start.
  • 5. Then we started getting a bit clever with JS function UserManager(){ this.userDetails = {}; } UserManager.prototype.setName = function( firstName, lastName ) { return this.userDetails.name = firstName + ' ' + lastName; }; var billy = new UserManager(); billy.setName('Billy', 'Smith'); console.log(billy); output: UserManager {userDetails: Object, setName: function} userDetails: Object name: "Billy Smith" __proto__: Object __proto__: UserManager
  • 6. Object-Orientated JS really became popular var Cat = new Class({}); - mootools jQuery.extend( target [, object1 ] [, objectN ] ) - jQuery var HelloWorld = angular.module("Demo", []); HelloWorld.factory("FooBar", function() {}); - Angular var HelloMessage = React.createClass({}); - React.js
  • 7. But wasn’t quite as “elegant” as other languages
  • 8. ES6 made it classy Classes with inheritance: class UserManager extends Users {
  • 9. ES6 made it classy Classes with inheritance: class UserManager extends Users { Constructors: constructor() {
  • 10. ES6 made it classy Classes with inheritance: class UserManager extends Users { Constructors: constructor() { Getters/Setters: get name() {
  • 11. ES6 made it classy Classes with inheritance: class UserManager extends Users { Constructors: constructor() { Getters/Setters: get name() { Rest params: myMethod(...name) {
  • 12. ES6 made it classy Classes with inheritance: class UserManager extends Users { Constructors: constructor() { Getters/Setters: get name() { Rest params: myMethod(...name) { Default param values: myMethod(foo = 'my default string') {
  • 13. ES6 made it classy Classes with inheritance: class UserManager extends Users { Constructors: constructor() { Getters/Setters: get name() { Rest params: myMethod(...name) { Default param values: myMethod(foo = 'my default string') { Arrow functions: document.addEventListener('DOMReady', (e) => {
  • 14. This is the current support ES6 Support table by Kangax
  • 15. Yes, that was Microsoft Edge leading the way