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

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 

Último (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 

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