SlideShare a Scribd company logo
Modern JS in practice
Anders Fisher

Developer Mountain
Some caveats
• This is all based on my personal experience.
• There are other options available.
• Try to think about what your needs are.
• I’d love to hear about techniques/improvements!
Why ES6?
• More features than ES5.
• It’s backwards compatible.
• I don’t feel the need for a typed language.
• It’s well documented.
• It’s a standard!
Transpiling
• If your code is complex enough to have more than a few
simple concepts transpiling will give you more options.
• I like webpack and babel, but others are available.
• It gives you a compile step in your JS, for linting, TDD
and minifying.
• It allows you to develop a front end build process that
can be shared between very different projects.
What’s it called?
• ES5 is the sort of JS we had for a while until 2015.
• ES6 is ES2015 and has a range of new features.
• ES7 is ES2016 and expands the existing library
further.
• I’m currently mostly working ES2015 but calling it
ES6.
Compatibility
• Modern browsers are continuing to march forward,
now that Microsoft has ceased support for IE in
favour of edge. Modern browsers should keep
pace.
• caniuse.com is an excellent resource for support of
features of modern JS.
• Chrome already supports a lot of the features here.
Patterns to follow
• Divide your functionality into separate files.
• Keep a single responsibility for each file.
• Build a pipeline of functions to pass your data through.
• Keep your functions simple, pure and avoid side
effects.
• Use functional programming methods like map and
reduce to simplify code.
Enhancements
• Use let and const instead of var.
• Use => functions instead of call(this).
• Import/export in place of require.
• Use ` when using string interpolation.
Strings
• Strings in ES5 were a pain.
• Using backticks we can do string interpolation.
• Using backticks we can do multi-line strings!
• Suddenly templating libraries seem redundant!
Sugar
• JS can be cleaner and neater thanks to some of the
sugar provided in ES6.
• Shorthand in objects { foo: foo} becomes { foo }.
• Assignment of variables via destructuring.
• Method definitions have shorthand within object
literals.
Libraries
• There are load of modules for JS now (Yay NPM),
but a fair few of them are a bit ropey (Boo NPM).
• Including libraries in JS is now easier and more
reliable than ever, webpack and browserify give us
a simple reliable way to manage our external
resources.
• Try to be restrained when using external libraries,
they all need to be loaded in the browser! If in
doubt take a look at the source.
Example App

More Related Content

PDF
EclipseCon Europe 2011
PDF
Unit Testing in JavaScript
PPTX
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
PDF
Making CLI app in ruby
PPTX
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
PDF
Atomic design
PPTX
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
PDF
ES2015 / ES6: Basics of modern Javascript
EclipseCon Europe 2011
Unit Testing in JavaScript
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Making CLI app in ruby
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
Atomic design
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
ES2015 / ES6: Basics of modern Javascript

What's hot (20)

PPTX
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
PPTX
Functional Programming in PHP
PPTX
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
6 reasons you should program in go
PDF
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
PPTX
Journey To The Front End World - Part3 - The Machine
PDF
Miami2015
PDF
I Got 99 Problems and a Bash DSL Ain't One of Them
PPTX
Web development post io2016
PPT
JAZOON'13 - Oliver Zeigermann - Typed JavaScript with TypeScript
PDF
Jazoon2013 type script
PPTX
Building Your Own DSL with Xtext
PDF
Multiply like rabbits with rabbit mq
PPTX
How to Supercharge your PHP Web API
PDF
Always bet on JS - Finjs.io NYC 2016
PDF
Play with Elm!
PPTX
Into the Land of lambda, One Programmer's Journey Into Functional Programming
PPTX
Advanced JavaScript techniques
PPTX
2014 SpiceWorld London Breakout
PPTX
.Net without spending a buck
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
Functional Programming in PHP
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
6 reasons you should program in go
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
Journey To The Front End World - Part3 - The Machine
Miami2015
I Got 99 Problems and a Bash DSL Ain't One of Them
Web development post io2016
JAZOON'13 - Oliver Zeigermann - Typed JavaScript with TypeScript
Jazoon2013 type script
Building Your Own DSL with Xtext
Multiply like rabbits with rabbit mq
How to Supercharge your PHP Web API
Always bet on JS - Finjs.io NYC 2016
Play with Elm!
Into the Land of lambda, One Programmer's Journey Into Functional Programming
Advanced JavaScript techniques
2014 SpiceWorld London Breakout
.Net without spending a buck
Ad

Similar to Modern js in practice (20)

PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
PPTX
ES6 - JavaCro 2016
PPTX
Javascript best practices
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
PDF
High quality Front-End
PDF
7 Simple Things I Learned about JavaScript
PPTX
Intro to ES6 and why should you bother !
PPTX
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
PDF
Making ES6 available to all with ChakraCore
PDF
JavaScript for impatient programmers.pdf
PDF
[PDF]_Learning_ECMAScript_6.pdf
PDF
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
ODP
Javascript Update May 2013
PDF
Expert JavaScript Programming
PDF
Choosing Javascript Libraries to Adopt for Development
PPTX
The Javascript Ecosystem
PDF
Using RequireJS for Modular JavaScript Code
PDF
Making ES6 available to all with ChakraCore and Typescript
PDF
Overboard.js - where are we going with with jsconfasia / devfestasia
PDF
Javascript The Definitive Guide Fourth Flanagan David
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
ES6 - JavaCro 2016
Javascript best practices
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
High quality Front-End
7 Simple Things I Learned about JavaScript
Intro to ES6 and why should you bother !
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Making ES6 available to all with ChakraCore
JavaScript for impatient programmers.pdf
[PDF]_Learning_ECMAScript_6.pdf
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
Javascript Update May 2013
Expert JavaScript Programming
Choosing Javascript Libraries to Adopt for Development
The Javascript Ecosystem
Using RequireJS for Modular JavaScript Code
Making ES6 available to all with ChakraCore and Typescript
Overboard.js - where are we going with with jsconfasia / devfestasia
Javascript The Definitive Guide Fourth Flanagan David
Ad

More from fesuffolk (7)

PPTX
The Tarsus configurator - Toby Hope
PDF
FESuffolk: Monads in Javascript
PDF
FESuffolk Make lightning talk
PDF
SASS In The Real World
PDF
An Introduction to Unity
PDF
Be a #bada55 with colour contrast
PDF
#ff0000, #ffffff & #0000ff
The Tarsus configurator - Toby Hope
FESuffolk: Monads in Javascript
FESuffolk Make lightning talk
SASS In The Real World
An Introduction to Unity
Be a #bada55 with colour contrast
#ff0000, #ffffff & #0000ff

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Spectroscopy.pptx food analysis technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
A Presentation on Artificial Intelligence
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
A comparative analysis of optical character recognition models for extracting...
Encapsulation_ Review paper, used for researhc scholars
Review of recent advances in non-invasive hemoglobin estimation
Building Integrated photovoltaic BIPV_UPV.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Advanced methodologies resolving dimensionality complications for autism neur...

Modern js in practice

  • 1. Modern JS in practice Anders Fisher
 Developer Mountain
  • 2. Some caveats • This is all based on my personal experience. • There are other options available. • Try to think about what your needs are. • I’d love to hear about techniques/improvements!
  • 3. Why ES6? • More features than ES5. • It’s backwards compatible. • I don’t feel the need for a typed language. • It’s well documented. • It’s a standard!
  • 4. Transpiling • If your code is complex enough to have more than a few simple concepts transpiling will give you more options. • I like webpack and babel, but others are available. • It gives you a compile step in your JS, for linting, TDD and minifying. • It allows you to develop a front end build process that can be shared between very different projects.
  • 5. What’s it called? • ES5 is the sort of JS we had for a while until 2015. • ES6 is ES2015 and has a range of new features. • ES7 is ES2016 and expands the existing library further. • I’m currently mostly working ES2015 but calling it ES6.
  • 6. Compatibility • Modern browsers are continuing to march forward, now that Microsoft has ceased support for IE in favour of edge. Modern browsers should keep pace. • caniuse.com is an excellent resource for support of features of modern JS. • Chrome already supports a lot of the features here.
  • 7. Patterns to follow • Divide your functionality into separate files. • Keep a single responsibility for each file. • Build a pipeline of functions to pass your data through. • Keep your functions simple, pure and avoid side effects. • Use functional programming methods like map and reduce to simplify code.
  • 8. Enhancements • Use let and const instead of var. • Use => functions instead of call(this). • Import/export in place of require. • Use ` when using string interpolation.
  • 9. Strings • Strings in ES5 were a pain. • Using backticks we can do string interpolation. • Using backticks we can do multi-line strings! • Suddenly templating libraries seem redundant!
  • 10. Sugar • JS can be cleaner and neater thanks to some of the sugar provided in ES6. • Shorthand in objects { foo: foo} becomes { foo }. • Assignment of variables via destructuring. • Method definitions have shorthand within object literals.
  • 11. Libraries • There are load of modules for JS now (Yay NPM), but a fair few of them are a bit ropey (Boo NPM). • Including libraries in JS is now easier and more reliable than ever, webpack and browserify give us a simple reliable way to manage our external resources. • Try to be restrained when using external libraries, they all need to be loaded in the browser! If in doubt take a look at the source.