SlideShare uma empresa Scribd logo
1 de 26
I just met you, and 'this' is crazy, 
but here's my NaN, so call(me) 
maybe? 
JavaScript is so weird
What makes JavaScript fun? 
(and by fun I mean....a little bit strange) 
• Eval 
• parseInt 
• NaN 
• With 
• JSLint/JSHint 
• Arrays 
• Switches 
• more... 
• JavaScript 
• Blocks 
• Functions 
• Null 
• Equality 
• Truthy/Falsey 
• Objects 
• this!
http://i.imgur.com/wR3ZxfB.jpg
JavaScript 
...is not Java 
Java is to JavaScript as car is to carpet 
Java is to JavaScript as ham is to hamster
Syntax Error 
• Automatic semicolon silliness 
• {} 
• ;
Syntax Error 
• Most often, a newline (n) ends a statement unless... 
• The statement has an unclosed parenthesis ")", array literal, or object literal. 
• The line uses -- or ++ 
• Any block statements such as for, while, do, if, or else, and there is no starting 
bracket "{" 
• After these constructs: break, continue, return, throw
Just say no to single line blocks 
One single line 
if (ok) 
x = true; 
Then looks like 
(to the dev) 
if (ok) 
x = true; 
callFunc(); 
Devs turn into 
if (ok) 
x = true; 
callFunc(); 
In reality it is 
(to the parser) 
if (ok) { 
x = true; 
} 
callFunc();
Putting the "fun" in functions 
function functionStatement() { 
// Some code 
return value; 
} 
var functionExpression = function() { 
// Some code 
return value; 
};
Putting the "fun" in functions 
(function () { 
console.log("anonymous function"); 
})(); 
(function IIFE() { 
console.log("function expression"); 
})();
Putting the "fun" in functions 
function main() { 
functionStatement(); 
function functionStatement() { ... } 
// oh noes! this won't work 
functionExpression(); 
var functionExpression = function() { ... } 
}
DEMO 
• Fun with functions
Arrays 
• There is no such thing 
• No dimensions 
• No out of bounds errors 
• typeof doesn't know the difference
Carry on 
• continue statement 
"I've never seen a piece of code that was not improved by 
removing it" 
-- Crockford
The switch 
• Auto fallthrough switch (expression) { 
case expression: 
statements 
[break;] 
case expression: 
statements 
[break;] 
default: 
statements 
[break;] 
}
Let's get to the truth of the matter 
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
All things being equal-ish. Maybe. 
== === 
!= !==
DEMO 
• Truthy and Falsey
Just what's up with this, anyway?
Eval - the most evil of all? 
Or just a lowly, misunderstood, function? 
var x = eval("forms[0].option" + optionNumber + ".checked"); 
var x = forms[0]["option" + optionNumber].checked;
Are you with me, or against me? 
with (objX) { 
// statements 
}
New, new, don't do 
• typed wrappers 
• new object 
• new array 
• new Date
farceInt(fib); 
static int parseInt(String s) 
static int parseInt(String s, int radix)
parseInt's farce parsing 
0X or 0x 16 (hexadecimal) 
0 10 (decimal) 
8 (octal) 
Everything else 10 (decimal) 
var result = parseInt(numericString, 10);
NaN 
• It claims it's NotANumber, but it's a number. 
• Don't use equality operators with NaN 
• Use Number.isNaN() instead 
• Use typeof instead 
• Don't use plain isNaN() – or else nothing is a number! 
• ES6 Number.isNaN()
Seems legit 
var add = function() { 
return arguments[0] + arguments[1]; 
Is legit 
function(where are the arguments?) { 
}; 
console.log(add(4, 4)); // returns 8
How to avoid all the odd stuff 
• JSLint 
• JSHint 
• JSFiddle

Mais conteúdo relacionado

Mais procurados

Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)mircodotta
 
Why TypeScript?
Why TypeScript?Why TypeScript?
Why TypeScript?FITC
 
Swift in SwiftUI
Swift in SwiftUISwift in SwiftUI
Swift in SwiftUIBongwon Lee
 
Java script good_bad_awful
Java script good_bad_awfulJava script good_bad_awful
Java script good_bad_awfulmoamen_mokhtar
 
O caml2014 leroy-slides
O caml2014 leroy-slidesO caml2014 leroy-slides
O caml2014 leroy-slidesOCaml
 
Understanding JavaScript
Understanding JavaScriptUnderstanding JavaScript
Understanding JavaScriptnodejsbcn
 
Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015Leonardo Borges
 
As Triage Code Camp
As Triage Code CampAs Triage Code Camp
As Triage Code CampRob Sawyer
 
Scala - just good for Java shops?
Scala - just good for Java shops?Scala - just good for Java shops?
Scala - just good for Java shops?Sarah Mount
 
Swift で JavaScript 始めませんか? #iOSDC
Swift で JavaScript 始めませんか? #iOSDCSwift で JavaScript 始めませんか? #iOSDC
Swift で JavaScript 始めませんか? #iOSDCTomohiro Kumagai
 
Automated code audits
Automated code auditsAutomated code audits
Automated code auditsexakat
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)mircodotta
 
Writing beautiful code with Java 8
Writing beautiful code with Java 8Writing beautiful code with Java 8
Writing beautiful code with Java 8Sergiu Mircea Indrie
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Eugene Zharkov
 
Understanding Javascript Engines
Understanding Javascript Engines Understanding Javascript Engines
Understanding Javascript Engines Parashuram N
 
Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!Kel Cecil
 
Templates exception handling
Templates exception handlingTemplates exception handling
Templates exception handlingsanya6900
 
All You Need to Know About Type Script
All You Need to Know About Type ScriptAll You Need to Know About Type Script
All You Need to Know About Type ScriptFolio3 Software
 
It's All About Morphisms
It's All About MorphismsIt's All About Morphisms
It's All About MorphismsUberto Barbini
 

Mais procurados (20)

Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
 
Why TypeScript?
Why TypeScript?Why TypeScript?
Why TypeScript?
 
Swift in SwiftUI
Swift in SwiftUISwift in SwiftUI
Swift in SwiftUI
 
Java script good_bad_awful
Java script good_bad_awfulJava script good_bad_awful
Java script good_bad_awful
 
O caml2014 leroy-slides
O caml2014 leroy-slidesO caml2014 leroy-slides
O caml2014 leroy-slides
 
Kotlin Starter Pack
Kotlin Starter PackKotlin Starter Pack
Kotlin Starter Pack
 
Understanding JavaScript
Understanding JavaScriptUnderstanding JavaScript
Understanding JavaScript
 
Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015
 
As Triage Code Camp
As Triage Code CampAs Triage Code Camp
As Triage Code Camp
 
Scala - just good for Java shops?
Scala - just good for Java shops?Scala - just good for Java shops?
Scala - just good for Java shops?
 
Swift で JavaScript 始めませんか? #iOSDC
Swift で JavaScript 始めませんか? #iOSDCSwift で JavaScript 始めませんか? #iOSDC
Swift で JavaScript 始めませんか? #iOSDC
 
Automated code audits
Automated code auditsAutomated code audits
Automated code audits
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
 
Writing beautiful code with Java 8
Writing beautiful code with Java 8Writing beautiful code with Java 8
Writing beautiful code with Java 8
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?
 
Understanding Javascript Engines
Understanding Javascript Engines Understanding Javascript Engines
Understanding Javascript Engines
 
Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!
 
Templates exception handling
Templates exception handlingTemplates exception handling
Templates exception handling
 
All You Need to Know About Type Script
All You Need to Know About Type ScriptAll You Need to Know About Type Script
All You Need to Know About Type Script
 
It's All About Morphisms
It's All About MorphismsIt's All About Morphisms
It's All About Morphisms
 

Semelhante a I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? by Rachel Appel

Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of JavascriptUniverse41
 
Javascript basics
Javascript basicsJavascript basics
Javascript basicsSolv AS
 
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Things that every JavaScript developer should know by Rachel Appel at FrontCo...Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Things that every JavaScript developer should know by Rachel Appel at FrontCo...DevClub_lv
 
LinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: IntroLinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: IntroAdam Crabtree
 
Introduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxIntroduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxDavid Rodenas
 
A JavaScript Master Class - From the Wows to the WTFs
A JavaScript Master Class - From the Wows to the WTFsA JavaScript Master Class - From the Wows to the WTFs
A JavaScript Master Class - From the Wows to the WTFsShahriar Hyder
 
Making JavaScript Libraries More Approachable
Making JavaScript Libraries More ApproachableMaking JavaScript Libraries More Approachable
Making JavaScript Libraries More ApproachablePamela Fox
 
Dan Shappir "JavaScript Riddles For Fun And Profit"
Dan Shappir "JavaScript Riddles For Fun And Profit"Dan Shappir "JavaScript Riddles For Fun And Profit"
Dan Shappir "JavaScript Riddles For Fun And Profit"Fwdays
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almostQuinton Sheppard
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptRangana Sampath
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingKeshav Kumar
 

Semelhante a I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? by Rachel Appel (20)

The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
 
Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of Javascript
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Things that every JavaScript developer should know by Rachel Appel at FrontCo...Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
 
What JS? Itself
What JS? ItselfWhat JS? Itself
What JS? Itself
 
Ruby Gotchas
Ruby GotchasRuby Gotchas
Ruby Gotchas
 
LinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: IntroLinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: Intro
 
Introduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxIntroduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicox
 
Pythonintro
PythonintroPythonintro
Pythonintro
 
Fancy talk
Fancy talkFancy talk
Fancy talk
 
Java Tutorial
Java Tutorial Java Tutorial
Java Tutorial
 
A JavaScript Master Class - From the Wows to the WTFs
A JavaScript Master Class - From the Wows to the WTFsA JavaScript Master Class - From the Wows to the WTFs
A JavaScript Master Class - From the Wows to the WTFs
 
Making JavaScript Libraries More Approachable
Making JavaScript Libraries More ApproachableMaking JavaScript Libraries More Approachable
Making JavaScript Libraries More Approachable
 
Dan Shappir "JavaScript Riddles For Fun And Profit"
Dan Shappir "JavaScript Riddles For Fun And Profit"Dan Shappir "JavaScript Riddles For Fun And Profit"
Dan Shappir "JavaScript Riddles For Fun And Profit"
 
Json the-x-in-ajax1588
Json the-x-in-ajax1588Json the-x-in-ajax1588
Json the-x-in-ajax1588
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almost
 
Chapter3
Chapter3Chapter3
Chapter3
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Ruby Gotchas
Ruby GotchasRuby Gotchas
Ruby Gotchas
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programming
 

Mais de .NET Conf UY

Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo FinochiettiRoslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti.NET Conf UY
 
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci....NET Conf UY
 
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel.NET Conf UY
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel.NET Conf UY
 
Windows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo GarciaWindows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo Garcia.NET Conf UY
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo....NET Conf UY
 
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E....NET Conf UY
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ....NET Conf UY
 
Emprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel CamargoEmprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel Camargo.NET Conf UY
 
Microsoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo MangarelliMicrosoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo Mangarelli.NET Conf UY
 
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando MachadoArquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado.NET Conf UY
 
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ....NET Conf UY
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham.NET Conf UY
 
Opportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald BelchamOpportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald Belcham.NET Conf UY
 
RESTful Para todos by Diego Sapriza
RESTful Para todos by Diego SaprizaRESTful Para todos by Diego Sapriza
RESTful Para todos by Diego Sapriza.NET Conf UY
 
Introduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald BelchamIntroduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald Belcham.NET Conf UY
 
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan FernandezFun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez.NET Conf UY
 
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A....NET Conf UY
 

Mais de .NET Conf UY (18)

Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo FinochiettiRoslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
 
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
 
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
 
Windows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo GarciaWindows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo Garcia
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
 
Emprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel CamargoEmprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel Camargo
 
Microsoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo MangarelliMicrosoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo Mangarelli
 
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando MachadoArquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
 
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
Opportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald BelchamOpportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald Belcham
 
RESTful Para todos by Diego Sapriza
RESTful Para todos by Diego SaprizaRESTful Para todos by Diego Sapriza
RESTful Para todos by Diego Sapriza
 
Introduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald BelchamIntroduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald Belcham
 
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan FernandezFun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
 
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
 

Último

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Último (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? by Rachel Appel

  • 1. I just met you, and 'this' is crazy, but here's my NaN, so call(me) maybe? JavaScript is so weird
  • 2. What makes JavaScript fun? (and by fun I mean....a little bit strange) • Eval • parseInt • NaN • With • JSLint/JSHint • Arrays • Switches • more... • JavaScript • Blocks • Functions • Null • Equality • Truthy/Falsey • Objects • this!
  • 4. JavaScript ...is not Java Java is to JavaScript as car is to carpet Java is to JavaScript as ham is to hamster
  • 5. Syntax Error • Automatic semicolon silliness • {} • ;
  • 6. Syntax Error • Most often, a newline (n) ends a statement unless... • The statement has an unclosed parenthesis ")", array literal, or object literal. • The line uses -- or ++ • Any block statements such as for, while, do, if, or else, and there is no starting bracket "{" • After these constructs: break, continue, return, throw
  • 7. Just say no to single line blocks One single line if (ok) x = true; Then looks like (to the dev) if (ok) x = true; callFunc(); Devs turn into if (ok) x = true; callFunc(); In reality it is (to the parser) if (ok) { x = true; } callFunc();
  • 8. Putting the "fun" in functions function functionStatement() { // Some code return value; } var functionExpression = function() { // Some code return value; };
  • 9. Putting the "fun" in functions (function () { console.log("anonymous function"); })(); (function IIFE() { console.log("function expression"); })();
  • 10. Putting the "fun" in functions function main() { functionStatement(); function functionStatement() { ... } // oh noes! this won't work functionExpression(); var functionExpression = function() { ... } }
  • 11. DEMO • Fun with functions
  • 12. Arrays • There is no such thing • No dimensions • No out of bounds errors • typeof doesn't know the difference
  • 13. Carry on • continue statement "I've never seen a piece of code that was not improved by removing it" -- Crockford
  • 14. The switch • Auto fallthrough switch (expression) { case expression: statements [break;] case expression: statements [break;] default: statements [break;] }
  • 15. Let's get to the truth of the matter 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
  • 16. All things being equal-ish. Maybe. == === != !==
  • 17. DEMO • Truthy and Falsey
  • 18. Just what's up with this, anyway?
  • 19. Eval - the most evil of all? Or just a lowly, misunderstood, function? var x = eval("forms[0].option" + optionNumber + ".checked"); var x = forms[0]["option" + optionNumber].checked;
  • 20. Are you with me, or against me? with (objX) { // statements }
  • 21. New, new, don't do • typed wrappers • new object • new array • new Date
  • 22. farceInt(fib); static int parseInt(String s) static int parseInt(String s, int radix)
  • 23. parseInt's farce parsing 0X or 0x 16 (hexadecimal) 0 10 (decimal) 8 (octal) Everything else 10 (decimal) var result = parseInt(numericString, 10);
  • 24. NaN • It claims it's NotANumber, but it's a number. • Don't use equality operators with NaN • Use Number.isNaN() instead • Use typeof instead • Don't use plain isNaN() – or else nothing is a number! • ES6 Number.isNaN()
  • 25. Seems legit var add = function() { return arguments[0] + arguments[1]; Is legit function(where are the arguments?) { }; console.log(add(4, 4)); // returns 8
  • 26. How to avoid all the odd stuff • JSLint • JSHint • JSFiddle

Notas do Editor

  1. Image Source http://i.imgur.com/wR3ZxfB.jpg
  2. Sometimes JS treats a function like a value and sometimes it treats it as an executable block of code. This is why we have both functions statement and function expression. Let's dig into each: -The function statement Syntactically the function statement starts with the function keyword then names the function end encloses the function contents with brackets. Use a function statement to declare a function that you will use later. The code in between the brackets will not execute until the function is called from somewhere else. Inside of a function statement we use the return keyword to return a value to the calling code. Functions statements load at parse time before any code is executed. Function expressions, on the other hand, loads when the interpreter reaches that line of code. – that means they load at runtime. So if you try to call a function expression before it's loaded, you'll get an error. But if you call a function declaration, it'll always work. Because no code can be called until all declarations are loaded.
  3. Function expressions run immediately, and when they do it's called an IIFE or Immediately-Invoked Function Expression  An Immediately-Invoked Function Expression is the only function that you can't call, it simply executes on the spot as the interpreter hits its location in code. What makes the function execute immediately is the syntactic location of empty parenthesis just after the function's closing curly bracket.
  4. You have flexibility in choosing the calling syntax, depending on whether or not you plan on using the return value. Regardless, it is the loading behavior that is more important than the syntax. In the on screen sample, we see how the code will work, but we should investigate the mechanics of how function statements and expressions work. [demo]
  5. Let's see JavaScript run some functions and determine the difference in loading between statements and expressions. As you can see here in the demo, we have a web page in IE on the left and the IE debug tools on the right. The developer tools show an html page containing a single button that runs some script. In its corresponding JS file we see the declarations for all 3 function types starting with a function statement the top of the file that returns a string into a variable named "s" in the calling code. The function expression does the same by returning a string with the value "function expression" in it, and it returns that value into a variable named "e". In this case we are using both the function statement and expression the same way. These two functions sit alongside an IIFE, which does not return any value as its job is to run the code immediately. let's create a breakpoint, and see these dynamics in action. But before we do, let's take note that the call to the function expression happens before its location so that should error. I'll hit F5 now. As you can see, the code doesn't even make it to the break point. The function statement runs as you'd expect. The expression does not. This is because its trying to call the function expression before it loads, and expressions load where they are located in code – so it's not loaded yet. If we swap the call and declaration of the function expression, then it should work. Let's try running the code again. We see it makes it to the breakpoint, so we know the expression has worked. Let's continue running and take a look at the IE output console, we can see that all three functions run, including the IIFE that ran with no need to call it.
  6. Arrays in JS aren't real arrays, they're phony no dimenstions no out of bounds errors
  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. 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.
  9. 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);
  10. Let's look at how JavaScript compares some values with both the standard equality operator and the exactly equals operator. I'll paste in some expressions that log their output First, does 0 == '' (zero = empty string). The equality operator says yes and exactly equals says no. ** 0 == '0' // true (zero and quoted zero, that's ) Again, The equality operator says yes and exactly equals says no. false == 'false' // false (does false = a quoted false) That's a result of false on both lines of code, false == '0' // true (does false = quoted zero) That's conflicting results between the operators false == undefined is in agreement between them as is false == null But null == undefined is true for equals but false for exactly equals, and the oddest of all, ' \t\r\n ' == 0 // true (tab, carriage return, new line) DOES equal zero, sometimes. But not really. (reverse operands and try ===) **
  11. 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!");
  12. JavaScript contains a function named eval that allows you to run dynamic snippets of code. While this sounds like a great idea, it can introduce some nasty security bugs, as malicious users can try to insert and run malicious code. The thing is - there's usually a better, clearer, and easier way than resorting to eval. When folks use eval it is usually because they are unaware that there is a perfectly fine alternative in JS already. For example, something like this (1st bullet) where eval ties a dropdown's option to Since you're executing dynamic code created at runtime, it's going to be slower than regular JS parsing. Debugging is a challenge Most often, programmers use eval to parse string numerals to array subscripts --Can be changed to— function isChecked(optionNumber) } var result = isChecked(1); FRIENDS OF EVAL – settimeout new function
  13. Just like in VB, JS has a with statement. This statement allows you to block off some code to work directly with variables using a shortened syntax. While this seems like a feature it usually ends up confusing developer rather than helping. For one, it's sporadic and inconsistent usage makes it difficult as it rarely adheres to any company or teams coding standards.
  14. parseInt is a function that accepts a string and parses it to ensure it is an integer. It has two method signatures, one which accepts only the string to convert, and the next accepts a string and a radix, or base, such as base 2, or base 10. Most software runs perfectly fine in base 10 systems and we normally don't need to specify that as the default. However, parseInt doesn't rely on what the system defaults are to perform its duty. Rather, parseInt assumes the radix based on the following rules: [next slide]
  15. If the input string begins with "0x" or "0X", radix is 16 (hexadecimal) and the remainder of the string is parsed. If the input string begins with "0", the radix could be octal or decimal.  The radix that parseInt uses is dependent on external factors like whether or not the browser supports it based on its ES5 implementation. If the input string begins with any other value, the radix is 10 (decimal). Your choice is to try to memorize all these facts or, just make it a rule that you specify a radix when using parseInt. The syntax will look something like this [show sample] It seems the latter is far easier to remember, code, and maintain. As an example of parseInt's craziness, let's examine a sample from the Mozilla Developer center of 15 different calls https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt parseInt("2A",16); parseInt("2A", 8); --- parseInt("2A",16); // 42 parseInt("2A", 10); // 2 parseInt("2A", 8); // 2 parseInt(42.99, 10); // 42 --- from Mozilla parseInt(" 0xF", 16); parseInt(" F", 16); parseInt("17", 8); parseInt(021, 8); parseInt("015", 10); parseInt(15.99, 10); parseInt("FXX123", 16); parseInt("1111", 2); parseInt("15*3", 10); parseInt("15e2", 10); parseInt("15px", 10); parseInt("12", 13); console.log(parseInt(" 0xF", 16)); console.log(parseInt(" F", 16)); console.log(parseInt("17", 8)); console.log(parseInt(021, 8)); console.log(parseInt("015", 10)); console.log(parseInt(15.99, 10)); console.log(parseInt("FXX123", 16)); console.log(parseInt("1111", 2)); console.log(parseInt("15*3", 10)); console.log(parseInt("15e2", 10)); console.log(parseInt("15px", 10)); console.log(parseInt("12", 13));
  16. typeof NaN returns 'number' the lolz with that one
  17. With all these crazy things that JS does, we need to ensure our code actually works! As you've learned, JS has enough rules that memorizing them is a daunting task. That's no problem though, as we have tools to help us verify (or lint), our code. JSFiddle – Of course I've been using this throughout the course. JSFiddle as you know is an online playground that lets you work with html, css, and js, of course, all online. What we didn't talk about is that can save code and perform some linting with JSHint to test out again later. JSLint – This is another online utility by Douglas Crockford (author of a famous JS book called "Javascript The good parts") JSHint – JSLint is quite sharp and stricts, so JSHint is a lightweight version of JSLint. Of course if you develop software for a company you might use Visual Studio that has linting options and tools, as well as Jet Brain's editor named Web Storm. No longer will you be stuck when JavaScript decides to misbehave. You've learned that Javascript has many quirks from simply annoying to downright nasty. To make sure that JavaScript is used correctly and effectively by your team, balance their styles and skills against the many gotchas you've learned here. Just as well you can use JSLint and JSHint to your advantage to assist you in writing better code!