SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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 ...
 

Dernier

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
#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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Dernier (20)

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
#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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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...
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

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