SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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 ...
 

Recently uploaded

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
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

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
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

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