SlideShare a Scribd company logo
Things that every JS
developer should know
Rachel Appel | JetBrains
http://rachelappel.com
rachel@rachelappel.com
@RachelAppel
What’s in this talk?
• Basic things are important for every JS developer
• So are some advanced things
It does. Its origins
are from JS.
Seriously
WTF?!?
LOL WAT?!?
Data Types
• There really are data types in JavaScript!
• But does JavaScript care?
• Value types (aka primitives)
• Number, string, Boolean, null, undefined, object, symbol
• Reference types
• Objects and arrays
Functions & Scope
Callable objects
Key-value dictionaries under the hood
Global
<script src="1.js">
var a, b, c
<script src="2.js">
var a, b, c
<script src="3.js">
var a, b, c
<script src="4.js">
var a, b, c
Window object
Global namespace pollution
Module/Module Reveal Pattern
var vs let
• var is function scoped
• Can declare globally or locally
• let is block scoped
• Declarations are limited in scope
to the block
A closure is a special kind of object that combines
two things: a function, and the environment in
which that function was created. The environment
consists of any local variables that were in-scope
at the time that the closure was created.
Lexical scope: captures variables from parent
scopes
arrow functions and closures
• Arrows don’t create their own value for ‘this’
• They use the enclosing block
Inheritance
• Prototype-base inheritance, changing the prototype of an object.
• ES6 classes and extends
• defineproperty
•
Arrays
• Is it a true Array?
• No dimensions, per se
• No out of bounds errors
• typeof calls it an object
• [] vs Array
== ===
Smooth Operators
!= !==
Truthy values
'false' (quoted false)
'0' (quoted zero)
() (empty functions)
[] (empty arrays)
{} (empty objects)
All other values
Falsey values
false
0 (zero)
'' (empty string)
null
undefined
NaN
Let's get to the truth of the matter
http://dorey.github.io/JavaScript-Equality-Table/
JavaScript
Equality
Table
Just what's up with this, anyway?
Typescript and this event obj
Sometimes when I'm writing JavaScript, I
just want to throw my hands up and yell
"This is bullshit!", but I can never remember
what "this" is referring to.
Strict mode [ES5]
• “use strict”
• No more accidental globals
• Must declare variables
• Assignment issues are no longer silent. They throw errors
• Function args with same name (yep, vanilla JS allows that)
Seems legit
var add = function() {
// do stuff
};
Yeah it’s legit! This is JavaScript!
console.log(add(4, 4, “cat”));
Look ma, no arguments!
Wait, what? Seriously?
Garbage collection
• Reachable
• Local variables and parameters of the current function.
• Variables and parameters for other functions on the current chain of nested
calls.
• Global variables.
• Internal stuff
Garbage collection
• The basic garbage collection algorithm is called “mark-and-sweep”.
• The following “garbage collection” steps are regularly performed:
• The garbage collector marks roots.
• It marks all references from them
• It visits marked objects and marks their references. (everything is tracked)
• Loop until unvisited refs happen
• All objects except marked ones are removed.
Typescript, compilers, transpilers, tools
• TypeScript
• Babel
• Webpack
• Typescript can validate JS code – just run them the compiler, like a
light linter
• Thank you!

More Related Content

What's hot

A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
Intro to kotlin
Intro to kotlinIntro to kotlin
Intro to kotlin
Tomislav Homan
 
Java script ppt
Java script pptJava script ppt
An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506Vu Hung Nguyen
 
An introduction-to-ruby-on-rails
An introduction-to-ruby-on-railsAn introduction-to-ruby-on-rails
An introduction-to-ruby-on-railsvinicorp
 
Lua pitfalls
Lua pitfallsLua pitfalls
Lua pitfalls
Dmitriy Kotelnikov
 
Comparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value TypesComparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value Types
Péter Verhás
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
Debmalya Jash
 
Introduction to Kotlin JVM language
Introduction to Kotlin JVM languageIntroduction to Kotlin JVM language
Introduction to Kotlin JVM language
Andrius Klimavicius
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
mametter
 
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
raja kvk
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
mametter
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
Alessandro Giorgetti
 
New c sharp4_features_part_v
New c sharp4_features_part_vNew c sharp4_features_part_v
New c sharp4_features_part_v
Nico Ludwig
 
Object Oriented JavaScript - II
Object Oriented JavaScript - IIObject Oriented JavaScript - II
Object Oriented JavaScript - II
TO THE NEW | Technology
 
Beginning Java for .NET developers
Beginning Java for .NET developersBeginning Java for .NET developers
Beginning Java for .NET developers
Andrei Rinea
 
TypeScript
TypeScriptTypeScript
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
Offirmo
 
Getting Started with TypeScript
Getting Started with TypeScriptGetting Started with TypeScript
Getting Started with TypeScript
Gil Fink
 

What's hot (19)

A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
 
Intro to kotlin
Intro to kotlinIntro to kotlin
Intro to kotlin
 
Java script ppt
Java script pptJava script ppt
Java script ppt
 
An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506
 
An introduction-to-ruby-on-rails
An introduction-to-ruby-on-railsAn introduction-to-ruby-on-rails
An introduction-to-ruby-on-rails
 
Lua pitfalls
Lua pitfallsLua pitfalls
Lua pitfalls
 
Comparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value TypesComparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value Types
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
 
Introduction to Kotlin JVM language
Introduction to Kotlin JVM languageIntroduction to Kotlin JVM language
Introduction to Kotlin JVM language
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
 
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
New c sharp4_features_part_v
New c sharp4_features_part_vNew c sharp4_features_part_v
New c sharp4_features_part_v
 
Object Oriented JavaScript - II
Object Oriented JavaScript - IIObject Oriented JavaScript - II
Object Oriented JavaScript - II
 
Beginning Java for .NET developers
Beginning Java for .NET developersBeginning Java for .NET developers
Beginning Java for .NET developers
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
Getting Started with TypeScript
Getting Started with TypeScriptGetting Started with TypeScript
Getting Started with TypeScript
 

Similar to Things that every JavaScript developer should know by Rachel Appel at FrontCon 2019

Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
jaxLondonConference
 
Java script basics
Java script basicsJava script basics
Java script basics
Shrivardhan Limbkar
 
Implementing a JavaScript Engine
Implementing a JavaScript EngineImplementing a JavaScript Engine
Implementing a JavaScript Engine
Kris Mok
 
Intermediate JavaScript
Intermediate JavaScriptIntermediate JavaScript
Intermediate JavaScript
☆ Milan Adamovsky ☆
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
colinbdclark
 
Ajax and JavaScript Bootcamp
Ajax and JavaScript BootcampAjax and JavaScript Bootcamp
Ajax and JavaScript Bootcamp
AndreCharland
 
Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?
Mario Camou Riveroll
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft Training
Radoslav Georgiev
 
Javascript
JavascriptJavascript
Javascript
Sunil Thakur
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
.NET Conf UY
 
Interesting Facts About Javascript
Interesting Facts About JavascriptInteresting Facts About Javascript
Interesting Facts About Javascript
Manish Jangir
 
Metaprogramming JavaScript
Metaprogramming  JavaScriptMetaprogramming  JavaScript
Metaprogramming JavaScript
danwrong
 
JSLT: JSON querying and transformation
JSLT: JSON querying and transformationJSLT: JSON querying and transformation
JSLT: JSON querying and transformation
Lars Marius Garshol
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)mircodotta
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!
bwullems
 
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsIntroduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Daniel McGhan
 

Similar to Things that every JavaScript developer should know by Rachel Appel at FrontCon 2019 (20)

Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Implementing a JavaScript Engine
Implementing a JavaScript EngineImplementing a JavaScript Engine
Implementing a JavaScript Engine
 
Intermediate JavaScript
Intermediate JavaScriptIntermediate JavaScript
Intermediate JavaScript
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
 
Ajax and JavaScript Bootcamp
Ajax and JavaScript BootcampAjax and JavaScript Bootcamp
Ajax and JavaScript Bootcamp
 
Java script core
Java script coreJava script core
Java script core
 
Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft Training
 
Javascript
JavascriptJavascript
Javascript
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
 
Interesting Facts About Javascript
Interesting Facts About JavascriptInteresting Facts About Javascript
Interesting Facts About Javascript
 
jQuery Objects
jQuery ObjectsjQuery Objects
jQuery Objects
 
Metaprogramming JavaScript
Metaprogramming  JavaScriptMetaprogramming  JavaScript
Metaprogramming JavaScript
 
JSLT: JSON querying and transformation
JSLT: JSON querying and transformationJSLT: JSON querying and transformation
JSLT: JSON querying and transformation
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!
 
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsIntroduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
 

More from DevClub_lv

Fine-tuning Large Language Models by Dmitry Balabka
Fine-tuning Large Language Models by Dmitry BalabkaFine-tuning Large Language Models by Dmitry Balabka
Fine-tuning Large Language Models by Dmitry Balabka
DevClub_lv
 
"Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ...
"Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ..."Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ...
"Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ...
DevClub_lv
 
From 50 to 500 product engineers – data-driven approach to building impactful...
From 50 to 500 product engineers – data-driven approach to building impactful...From 50 to 500 product engineers – data-driven approach to building impactful...
From 50 to 500 product engineers – data-driven approach to building impactful...
DevClub_lv
 
Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...
Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...
Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...
DevClub_lv
 
Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...
Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...
Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...
DevClub_lv
 
Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...
Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...
Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...
DevClub_lv
 
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
DevClub_lv
 
SRE (service reliability engineer) on big DevOps platform running on the clou...
SRE (service reliability engineer) on big DevOps platform running on the clou...SRE (service reliability engineer) on big DevOps platform running on the clou...
SRE (service reliability engineer) on big DevOps platform running on the clou...
DevClub_lv
 
Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...
Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...
Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...
DevClub_lv
 
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
DevClub_lv
 
Building resilient frontend architecture by Monica Lent at FrontCon 2019
Building resilient frontend architecture by Monica Lent at FrontCon 2019Building resilient frontend architecture by Monica Lent at FrontCon 2019
Building resilient frontend architecture by Monica Lent at FrontCon 2019
DevClub_lv
 
In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...
In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...
In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...
DevClub_lv
 
Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019
Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019
Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019
DevClub_lv
 
V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...
V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...
V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...
DevClub_lv
 
Bridging the gap between UX and development - A Storybook by Marko Letic at F...
Bridging the gap between UX and development - A Storybook by Marko Letic at F...Bridging the gap between UX and development - A Storybook by Marko Letic at F...
Bridging the gap between UX and development - A Storybook by Marko Letic at F...
DevClub_lv
 
Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019
Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019
Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019
DevClub_lv
 
Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...
Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...
Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...
DevClub_lv
 
Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019
Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019
Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019
DevClub_lv
 
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
DevClub_lv
 
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
DevClub_lv
 

More from DevClub_lv (20)

Fine-tuning Large Language Models by Dmitry Balabka
Fine-tuning Large Language Models by Dmitry BalabkaFine-tuning Large Language Models by Dmitry Balabka
Fine-tuning Large Language Models by Dmitry Balabka
 
"Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ...
"Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ..."Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ...
"Infrastructure and AWS at Scale: The story of Posti" by Goran Gjorgievski @ ...
 
From 50 to 500 product engineers – data-driven approach to building impactful...
From 50 to 500 product engineers – data-driven approach to building impactful...From 50 to 500 product engineers – data-driven approach to building impactful...
From 50 to 500 product engineers – data-driven approach to building impactful...
 
Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...
Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...
Why is it so complex to accept a payment? by Dmitry Buzdin from A-Heads Consu...
 
Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...
Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...
Do we need DDD? by Jurijs Čudnovskis from “Craftsmans Passion” at Fintech foc...
 
Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...
Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...
Network security with Azure PaaS services by Erwin Staal from 4DotNet at Azur...
 
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
 
SRE (service reliability engineer) on big DevOps platform running on the clou...
SRE (service reliability engineer) on big DevOps platform running on the clou...SRE (service reliability engineer) on big DevOps platform running on the clou...
SRE (service reliability engineer) on big DevOps platform running on the clou...
 
Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...
Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...
Emergence of IOT & Cloud – Azure by Narendra Sharma at Cloud focused 76th Dev...
 
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
Cross Platform Mobile Development using Flutter by Wei Meng Lee at Mobile foc...
 
Building resilient frontend architecture by Monica Lent at FrontCon 2019
Building resilient frontend architecture by Monica Lent at FrontCon 2019Building resilient frontend architecture by Monica Lent at FrontCon 2019
Building resilient frontend architecture by Monica Lent at FrontCon 2019
 
In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...
In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...
In the Trenches During a Software Supply Chain Attack by Mitch Denny at Front...
 
Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019
Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019
Software Decision Making in Terms of Uncertainty by Ziv Levy at FrontCon 2019
 
V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...
V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...
V8 by example: A journey through the compilation pipeline by Ujjwas Sharma at...
 
Bridging the gap between UX and development - A Storybook by Marko Letic at F...
Bridging the gap between UX and development - A Storybook by Marko Letic at F...Bridging the gap between UX and development - A Storybook by Marko Letic at F...
Bridging the gap between UX and development - A Storybook by Marko Letic at F...
 
Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019
Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019
Case-study: Frontend in Cybersecurity by Ruslan Zavacky by FrontCon 2019
 
Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...
Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...
Building next generation PWA e-commerce frontend by Raivis Dejus at FrontCon ...
 
Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019
Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019
Parcel – your next web application bundler? by Janis Koselevs at FrontCon 2019
 
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
 
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
 

Recently uploaded

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Things that every JavaScript developer should know by Rachel Appel at FrontCon 2019

  • 1. Things that every JS developer should know Rachel Appel | JetBrains http://rachelappel.com rachel@rachelappel.com @RachelAppel
  • 2. What’s in this talk? • Basic things are important for every JS developer • So are some advanced things
  • 3.
  • 4. It does. Its origins are from JS. Seriously WTF?!? LOL WAT?!?
  • 5. Data Types • There really are data types in JavaScript! • But does JavaScript care? • Value types (aka primitives) • Number, string, Boolean, null, undefined, object, symbol • Reference types • Objects and arrays
  • 6. Functions & Scope Callable objects Key-value dictionaries under the hood
  • 7. Global <script src="1.js"> var a, b, c <script src="2.js"> var a, b, c <script src="3.js"> var a, b, c <script src="4.js"> var a, b, c Window object Global namespace pollution Module/Module Reveal Pattern
  • 8. var vs let • var is function scoped • Can declare globally or locally • let is block scoped • Declarations are limited in scope to the block
  • 9. A closure is a special kind of object that combines two things: a function, and the environment in which that function was created. The environment consists of any local variables that were in-scope at the time that the closure was created.
  • 10. Lexical scope: captures variables from parent scopes
  • 11. arrow functions and closures • Arrows don’t create their own value for ‘this’ • They use the enclosing block
  • 12. Inheritance • Prototype-base inheritance, changing the prototype of an object. • ES6 classes and extends • defineproperty •
  • 13. Arrays • Is it a true Array? • No dimensions, per se • No out of bounds errors • typeof calls it an object • [] vs Array
  • 15. Truthy values 'false' (quoted false) '0' (quoted zero) () (empty functions) [] (empty arrays) {} (empty objects) All other values Falsey values false 0 (zero) '' (empty string) null undefined NaN Let's get to the truth of the matter
  • 17. Just what's up with this, anyway? Typescript and this event obj
  • 18. Sometimes when I'm writing JavaScript, I just want to throw my hands up and yell "This is bullshit!", but I can never remember what "this" is referring to.
  • 19. Strict mode [ES5] • “use strict” • No more accidental globals • Must declare variables • Assignment issues are no longer silent. They throw errors • Function args with same name (yep, vanilla JS allows that)
  • 20. Seems legit var add = function() { // do stuff }; Yeah it’s legit! This is JavaScript! console.log(add(4, 4, “cat”)); Look ma, no arguments! Wait, what? Seriously?
  • 21. Garbage collection • Reachable • Local variables and parameters of the current function. • Variables and parameters for other functions on the current chain of nested calls. • Global variables. • Internal stuff
  • 22. Garbage collection • The basic garbage collection algorithm is called “mark-and-sweep”. • The following “garbage collection” steps are regularly performed: • The garbage collector marks roots. • It marks all references from them • It visits marked objects and marks their references. (everything is tracked) • Loop until unvisited refs happen • All objects except marked ones are removed.
  • 23. Typescript, compilers, transpilers, tools • TypeScript • Babel • Webpack • Typescript can validate JS code – just run them the compiler, like a light linter

Editor's Notes

  1. https://www.youtube.com/watch?v=9ooYYRLdg_g REF v VAL types typeof operator, in particular, that it returns “object” for null. Special numeric values Infinity, -Infinity and NaN Null It is not a reference to a non-existing object. It is not a null pointer It is a special value that means: dunno, unknown, nothing, empty, nada
  2. let allows you to declare variables that are limited in scope to the block, statement,or expression on which it is used. This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope
  3. A closure is a special kind of object that combines two things: a function, and the environment in which that function was created. The environment consists of any local variables that were in-scope at the time that the closure was created.
  4. In classic function expressions, the this keyword is bound to different values based on the context in which it is called. With arrow functions however, this is lexically bound. It means that it usesthis from the code that contains the arrow function.
  5. Arrays in JS aren't real arrays, they're phony no dimensions no out of bounds errors
  6. JavaScript has two sets of equality operators, equal to (==) and exactly equal to (===) and their counterparts in negation (!= and !==). The exactly equals works the way you expect. If the two operands are of the same type and have the same value, then exactly equals produces true and its negative partner (!==) produces false. The plain equals, OTOH, see different data types and attempts to coerce the values (it's called type coercion) by using a set of many overly complex rules. It's just not reasonable to memorize all these rules, especially if you are trying to create team standards from them. Therefore, since it's more accurate going with the exactly equals is the best option. Let's see some of this JS equality or non equality as the case may be, in action...[demo] THE TAKE AWAY: Use the === and !== opeartors as they give consistent and accurate results, more closely to what you might expect. console.log(0 == ''); console.log(0 === ''); console.log(0 == '0'); console.log(0 === '0'); console.log(false == 'false'); console.log(false === 'false'); console.log(false == '0'); console.log(false === '0'); console.log(false == undefined); console.log(false === undefined); console.log(false == null); console.log(false === null); console.log(null == undefined); console.log(null === undefined); console.log('\t\r\n' == 0); console.log('\t\r\n' === 0);
  7. What constitutes something falsy in JS? false. 0 (zero) "" (empty string) null undefined NaN (a special Number value meaning "Not a Number") All other values are truthy, including "0" (zero in quotes), "false" (false in quotes), empty functions, empty arrays, and empty objects.   Falsey: false 0 (zero) "" (empty string) null undefined NaN Truthy "false" (false in quotes) "0" (zero in quotes) () (empty functions) [] (empty arrays) {} (empty objects) All other values
  8. Many folks try to treat "this" the same way that it works in other languages and their notion of this is normally static and at the class level. JavaScript is different though, as this works based on the context of the calling code. Usually this belongs to the window, or global object, but it can also be the HTML element that has caused an event, for example, a button causing a click event. Then the function is owned by that source element and that element becomes this. To go a little deeper JavaScript functions run in an execution context that goes on the stack. The stack is an in memory storage location for variables and data. Functions are also values, and they're treated like objects/values. What this means is that each time another function runs, it gets pushed onto the stack and the context for "this" changes. That's unlike other languages where this is usually clearly defined. So the value of this depends on 2 things: What kind of code is executing? (global, function, or eval) and the calling code. ******* ES5 introduces the a way that you can set the value of "this" in a function, as the first argument of the call. Here in the IE console we have a function called saySomething that accepts a string and logs both this and the string to form a sentence about what this . Let's see it work. Now that I've run the function I can call it and make 'this' a programmer or a trekkie or katniss everdeen. Not that you'd wants strings to be this bit function saySomething(thing) { console.log(this + " says " + thing); } saySomething.call("A programmer", "Hello world"); saySomething.call("A Trekkie", "Live long and prosper."); saySomething.call("Katniss Everdeen", "May the odds be ever in your favor"); saySomething.call("A ghost", "Boooooooo!");
  9. Strict mode is part of the ECMAScript 5 standard. You can enable strict mode for a complete file or a single function: Complete file: put the line "use strict"; at the beginning of the file. As a statement, this does nothing and will be ignored by legacy JavaScript interpreters. Single function: using the mode for a complete file might break some functions in it, so by putting the line mentioned above at the beginning of a function, you can enable strict mode for it.
  10. It's not a main() MENTION APPLYMENTION APPLY MENTION APPLY
  11. https://javascript.info/garbage-collection There’s a base set of inherently reachable values, that cannot be deleted for obvious reasons. This algorithm looks out for objects which are unreachable from the root which is the JavaScript’s global object. This algorithm overcomes the limitations of Reference-counting algorithm. As an object with no references would be unreachable but not vice-versa.