SlideShare uma empresa Scribd logo
1 de 12
About duck typing in dynamic
languages:
“My god how you can write a real program
when you just assigning random crap to
another crap and expecting it to work”
                                             – John
   Carmack, founder of id Software, developer of
popular game titles like Wolfenstein , Doom, Quake
               and Rage, well-known open source
                              advocate, millionaire.
JavaScript is really
complicated language…
var a = 012
console.log( a )

→ 10




                   OMG!
console.log( "3" + 1 )

→ "31"

console.log( "3" – 1 )

→2


                         OMG!!
console.log( "222" - -"111" )

→ "333"


                         OMG!!!
console.log( 9999999999999999 )

→ 10000000000000000


                 OMG!!!!
console.log( 111111111111111111111 )

→ 111111111111111110000
console.log( Math.max() )

→ -Infinity

console.log( Math.min() )

→ Infinity

console.log( new Array([], null, undefined, null) == ",,,"; )

→ true

var foo = [0];
console.log(foo == !foo);
console.log(foo == foo);

→ true
→ true
console.log( 3.toString() )
console.log( 3..toString() )

→ SyntaxError: identifier starts immediately after numeric literal
→ "3"

var a = new Number;
console.log(a == 0)
var a = new String;
console.log(a == "")
var a = new Object;
console.log(a == {})
var a = new Array;
console.log(a == [])

→   true
→   true
→   false
→   false
var a = {};
console.log( a == {} );
var a = [];
console.log( a == [] );

→ false
→ false

console.log( (!+[]+[]+![]) );

→ "truefalse"

console.log(
(![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+
[])[!+[]+!+[]] )
→ "fail"
console.log( {} + {} );

→ NaN

console.log( [] + [] );

→ ""

console.log( [] + {} );

→ "[object Object]"

console.log( {} + [] );

→0

console.log( 1 < 2 < 3 );
console.log( 3 < 2 < 1);

→ true
→ true
JavaScript. Just be smarter!
Links
 WTF JavaScript: http://www.wtfjs.com/
 Destroy All Software Screencasts:
 http://www.destroyallsoftware.com/
 JavaScript Tutorial: http://www.javascript.info/
 JavaScript Specification:
 http://www.ecma-
 international.org/publications/standards/Ecma-
 262.htm

Mais conteúdo relacionado

Mais procurados

The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210Mahmoud Samir Fayed
 
2 13-2018-team with most games lost
2 13-2018-team with most games lost2 13-2018-team with most games lost
2 13-2018-team with most games lostAlexander Bitar
 
10b. Graph Databases Lab
10b. Graph Databases Lab10b. Graph Databases Lab
10b. Graph Databases LabFabio Fumarola
 
42: Rise of the dependent types
42: Rise of the dependent types42: Rise of the dependent types
42: Rise of the dependent typesGeorge Leontiev
 
Unleash your build with nuke
Unleash your build with nukeUnleash your build with nuke
Unleash your build with nukeTodor Todorov
 
Imports my sql
Imports my sqlImports my sql
Imports my sqlobertksg
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?Adam Dudczak
 
D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4Jan Berdajs
 
Macros code Copy paste visible data after filtering
Macros code Copy paste visible data after filteringMacros code Copy paste visible data after filtering
Macros code Copy paste visible data after filteringPramodkumar Jha
 
Raspberry pi gaming 4 kids
Raspberry pi gaming 4 kidsRaspberry pi gaming 4 kids
Raspberry pi gaming 4 kidsStephen Chin
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxEleanor McHugh
 
Type script in practice
Type script in practiceType script in practice
Type script in practiceBryan Hughes
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitTobias Pfeiffer
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitTobias Pfeiffer
 
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of IndifferenceRob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of IndifferenceHeroku
 

Mais procurados (20)

The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210
 
Lekcja stylu
Lekcja styluLekcja stylu
Lekcja stylu
 
2 13-2018-team with most games lost
2 13-2018-team with most games lost2 13-2018-team with most games lost
2 13-2018-team with most games lost
 
10b. Graph Databases Lab
10b. Graph Databases Lab10b. Graph Databases Lab
10b. Graph Databases Lab
 
42: Rise of the dependent types
42: Rise of the dependent types42: Rise of the dependent types
42: Rise of the dependent types
 
Unleash your build with nuke
Unleash your build with nukeUnleash your build with nuke
Unleash your build with nuke
 
A Python Crash Course
A Python Crash CourseA Python Crash Course
A Python Crash Course
 
Imports my sql
Imports my sqlImports my sql
Imports my sql
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
 
Signal Stacktrace
Signal StacktraceSignal Stacktrace
Signal Stacktrace
 
D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4
 
Macros code Copy paste visible data after filtering
Macros code Copy paste visible data after filteringMacros code Copy paste visible data after filtering
Macros code Copy paste visible data after filtering
 
Raspberry pi gaming 4 kids
Raspberry pi gaming 4 kidsRaspberry pi gaming 4 kids
Raspberry pi gaming 4 kids
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
 
Elixir talk
Elixir talkElixir talk
Elixir talk
 
Type script in practice
Type script in practiceType script in practice
Type script in practice
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicit
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicit
 
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of IndifferenceRob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
 
Recognize Godzilla
Recognize GodzillaRecognize Godzilla
Recognize Godzilla
 

Destaque

RESTful Web Services @AnkaraPHP meetup
RESTful Web Services @AnkaraPHP meetupRESTful Web Services @AnkaraPHP meetup
RESTful Web Services @AnkaraPHP meetupFatih Karatana
 
Connector Program Presentation for OneNS Coalition
Connector Program Presentation for OneNS CoalitionConnector Program Presentation for OneNS Coalition
Connector Program Presentation for OneNS CoalitionHalifax Partnership
 
Chris's friends
Chris's friendsChris's friends
Chris's friendsChris
 
Presentacion emprendimiento
Presentacion emprendimientoPresentacion emprendimiento
Presentacion emprendimientojessicamena95
 
Corporateblogging
CorporatebloggingCorporateblogging
Corporatebloggingguru5016
 
Gender in NTFP value chains in the Congo Basin
Gender in NTFP value chains in the Congo BasinGender in NTFP value chains in the Congo Basin
Gender in NTFP value chains in the Congo BasinVerina Ingram
 
Dissertation lyn woodward cwm jan 2010
Dissertation   lyn woodward cwm jan 2010Dissertation   lyn woodward cwm jan 2010
Dissertation lyn woodward cwm jan 2010Francis Alamina
 
Caching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental IndicesCaching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental IndicesRoi Blanco
 
Physical Science: Chapter 5, sec 2
Physical Science: Chapter 5, sec 2Physical Science: Chapter 5, sec 2
Physical Science: Chapter 5, sec 2mshenry
 
Integrating customary and legal systems for forest product governance, Cameroon
Integrating customary and legal systems for forest product governance, Cameroon Integrating customary and legal systems for forest product governance, Cameroon
Integrating customary and legal systems for forest product governance, Cameroon Verina Ingram
 
Web 2.0..Business Friend or Foe?
Web 2.0..Business Friend or Foe?Web 2.0..Business Friend or Foe?
Web 2.0..Business Friend or Foe?Stites & Harbison
 
Unravel uranus
Unravel uranus Unravel uranus
Unravel uranus Lisa Baird
 
Challenging Myths on HRM's Attitudes Towards Growth and Development 2008
Challenging Myths on HRM's Attitudes Towards Growth and Development 2008Challenging Myths on HRM's Attitudes Towards Growth and Development 2008
Challenging Myths on HRM's Attitudes Towards Growth and Development 2008Halifax Partnership
 
Boris Chan - FITC SCREENS - Becoming Social By Default on Mobile
Boris Chan - FITC SCREENS - Becoming Social By Default on MobileBoris Chan - FITC SCREENS - Becoming Social By Default on Mobile
Boris Chan - FITC SCREENS - Becoming Social By Default on MobileBoris Chan
 
Physical Science Ch 10
Physical Science Ch 10Physical Science Ch 10
Physical Science Ch 10mshenry
 

Destaque (20)

RESTful Web Services @AnkaraPHP meetup
RESTful Web Services @AnkaraPHP meetupRESTful Web Services @AnkaraPHP meetup
RESTful Web Services @AnkaraPHP meetup
 
Connector Program Presentation for OneNS Coalition
Connector Program Presentation for OneNS CoalitionConnector Program Presentation for OneNS Coalition
Connector Program Presentation for OneNS Coalition
 
Chris's friends
Chris's friendsChris's friends
Chris's friends
 
Presentacion emprendimiento
Presentacion emprendimientoPresentacion emprendimiento
Presentacion emprendimiento
 
Corporateblogging
CorporatebloggingCorporateblogging
Corporateblogging
 
Gender in NTFP value chains in the Congo Basin
Gender in NTFP value chains in the Congo BasinGender in NTFP value chains in the Congo Basin
Gender in NTFP value chains in the Congo Basin
 
Dissertation lyn woodward cwm jan 2010
Dissertation   lyn woodward cwm jan 2010Dissertation   lyn woodward cwm jan 2010
Dissertation lyn woodward cwm jan 2010
 
Gic2012 aula7-ingles
Gic2012 aula7-inglesGic2012 aula7-ingles
Gic2012 aula7-ingles
 
Caching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental IndicesCaching Search Engine Results over Incremental Indices
Caching Search Engine Results over Incremental Indices
 
Physical Science: Chapter 5, sec 2
Physical Science: Chapter 5, sec 2Physical Science: Chapter 5, sec 2
Physical Science: Chapter 5, sec 2
 
Integrating customary and legal systems for forest product governance, Cameroon
Integrating customary and legal systems for forest product governance, Cameroon Integrating customary and legal systems for forest product governance, Cameroon
Integrating customary and legal systems for forest product governance, Cameroon
 
Web 2.0..Business Friend or Foe?
Web 2.0..Business Friend or Foe?Web 2.0..Business Friend or Foe?
Web 2.0..Business Friend or Foe?
 
Gic2011 aula05-ingles
Gic2011 aula05-inglesGic2011 aula05-ingles
Gic2011 aula05-ingles
 
Jupiter1
Jupiter1Jupiter1
Jupiter1
 
Unravel uranus
Unravel uranus Unravel uranus
Unravel uranus
 
Challenging Myths on HRM's Attitudes Towards Growth and Development 2008
Challenging Myths on HRM's Attitudes Towards Growth and Development 2008Challenging Myths on HRM's Attitudes Towards Growth and Development 2008
Challenging Myths on HRM's Attitudes Towards Growth and Development 2008
 
Summit on Youth in NS Economy
Summit on Youth in NS EconomySummit on Youth in NS Economy
Summit on Youth in NS Economy
 
Boris Chan - FITC SCREENS - Becoming Social By Default on Mobile
Boris Chan - FITC SCREENS - Becoming Social By Default on MobileBoris Chan - FITC SCREENS - Becoming Social By Default on Mobile
Boris Chan - FITC SCREENS - Becoming Social By Default on Mobile
 
Physical Science Ch 10
Physical Science Ch 10Physical Science Ch 10
Physical Science Ch 10
 
Gic2011 aula1-ingles
Gic2011 aula1-inglesGic2011 aula1-ingles
Gic2011 aula1-ingles
 

Semelhante a OMG JavaScript

ZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game HackingZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game HackingHypnZA
 
Solving Business Problems with JS++
Solving Business Problems with JS++Solving Business Problems with JS++
Solving Business Problems with JS++Roger Poon
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data scienceJohn Cant
 
Chrome DevTools 101
Chrome DevTools 101Chrome DevTools 101
Chrome DevTools 101Juan Obando
 
Fb cheatsheet12b
Fb cheatsheet12bFb cheatsheet12b
Fb cheatsheet12bilesh raval
 
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...PROIDEA
 

Semelhante a OMG JavaScript (11)

ZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game HackingZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game Hacking
 
Chrome DevTools
Chrome DevToolsChrome DevTools
Chrome DevTools
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Solving Business Problems with JS++
Solving Business Problems with JS++Solving Business Problems with JS++
Solving Business Problems with JS++
 
XRobots
XRobotsXRobots
XRobots
 
Compiler
CompilerCompiler
Compiler
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data science
 
Chrome DevTools 101
Chrome DevTools 101Chrome DevTools 101
Chrome DevTools 101
 
Fb cheatsheet12b
Fb cheatsheet12bFb cheatsheet12b
Fb cheatsheet12b
 
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
 

Último

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
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
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 

Último (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
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
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 

OMG JavaScript

  • 1.
  • 2. About duck typing in dynamic languages: “My god how you can write a real program when you just assigning random crap to another crap and expecting it to work” – John Carmack, founder of id Software, developer of popular game titles like Wolfenstein , Doom, Quake and Rage, well-known open source advocate, millionaire.
  • 4. var a = 012 console.log( a ) → 10 OMG!
  • 5. console.log( "3" + 1 ) → "31" console.log( "3" – 1 ) →2 OMG!! console.log( "222" - -"111" ) → "333" OMG!!!
  • 6. console.log( 9999999999999999 ) → 10000000000000000 OMG!!!! console.log( 111111111111111111111 ) → 111111111111111110000
  • 7. console.log( Math.max() ) → -Infinity console.log( Math.min() ) → Infinity console.log( new Array([], null, undefined, null) == ",,,"; ) → true var foo = [0]; console.log(foo == !foo); console.log(foo == foo); → true → true
  • 8. console.log( 3.toString() ) console.log( 3..toString() ) → SyntaxError: identifier starts immediately after numeric literal → "3" var a = new Number; console.log(a == 0) var a = new String; console.log(a == "") var a = new Object; console.log(a == {}) var a = new Array; console.log(a == []) → true → true → false → false
  • 9. var a = {}; console.log( a == {} ); var a = []; console.log( a == [] ); → false → false console.log( (!+[]+[]+![]) ); → "truefalse" console.log( (![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+ [])[!+[]+!+[]] ) → "fail"
  • 10. console.log( {} + {} ); → NaN console.log( [] + [] ); → "" console.log( [] + {} ); → "[object Object]" console.log( {} + [] ); →0 console.log( 1 < 2 < 3 ); console.log( 3 < 2 < 1); → true → true
  • 12. Links WTF JavaScript: http://www.wtfjs.com/ Destroy All Software Screencasts: http://www.destroyallsoftware.com/ JavaScript Tutorial: http://www.javascript.info/ JavaScript Specification: http://www.ecma- international.org/publications/standards/Ecma- 262.htm