SlideShare a Scribd company logo
JavaScript
JavaScript
Enter the Dragon
JavaScript: enter the dragon
Most misunderstood language
You have no choice
…but you have plenty of options
JavaScript
JavaScript   human body
“If you have a body, you are an athlete”
           Bill Bowerman, co-founder of Nike.
If you code for the Web,
you are a JavaScript Developer
Control
JavaScript: enter the dragon
Why you “unfit”?
Why your JavaScript sucks?
JavaScript: enter the dragon
JavaScript: enter the dragon
“This is not important”
“I don’t need it any more, it’s XXI century”
           “I am good enough!”
       “It’s way too complicated”
        “I don’t have time for this”
Kyle Maynard — MMA fighter
Kyle Maynard — MMA fighter
Kyle Maynard — MMA fighter




Excuses… Let’s hear yours again
There are no shortcuts
“Those who are unaware
 they are walking in darkness
 will never seek the light.”
 Bruce Lee
Six essential bits
Six pack
1
Types & type coercion
object
 number
  string
 boolean
   null
undefined
5 - "4"
5 + "4"
+!{}[true]
+[1]
+[1, 2]
7 - "a"
7 / 0
…
2 Operators,
especially “+” & “==”
5 + "4"
5 + null
4 == "4.00"
null == undefined
0 == false
0 == null
null == false
typeof null == "object"
typeof function () {} == "function"
3
Objects & primitives
var a = "string";
alert(a.length);
a.t = 3;
alert(a.t);
4
Functions & constructors
function f() {};

var a   =   f
            ,
    b   =   f(),
    c   =   new f ,
    d   =   f(f);
5
Closures
function add(a) {
    return function (b) {
         return a + b;
    };
}

add(3)(4) == 7
6
Prototype
Prototypes in JavaScript
      in 5 minutes
function f() {};
                   f   P
function f() {};
f.prototype.x = 3;   f   P   x: 3
function f() {};
f.prototype.x = 3;   f   P   x: 3

var a = new f;

                     a
function f() {};
f.prototype.x = 3;    f     P   x: 3

var a = new f;
a.x = 2;
a.y = 1;              a
                     x: 2
                     y: 1
function f() {};
f.prototype.x = 3;    f     P   x: 3

var a = new f;
a.x = 2;
a.y = 1;              a     b
var b = new f;       x: 2
                     y: 1
function f() {};
f.prototype.x = 3;      z: 0   P2    f     P   x: 3

var a = new f;
a.x = 2;
a.y = 1;                             a     b
var b = new f;                      x: 2
f.prototype = {z: 0};               y: 1
function f() {};
f.prototype.x = 3;      z: 0   P2    f     P   x: 3

var a = new f;
a.x = 2;
a.y = 1;                       c     a     b
var b = new f;                      x: 2
f.prototype = {z: 0};               y: 1
var c = new f;
function f() {};
f.prototype.x = 3;      z: 0   P2    f     P   x: 3

var a = new f;
a.x = 2;
a.y = 1;                       c     a     b
var b = new f;                      x: 2
f.prototype = {z: 0};               y: 1
var c = new f;

               b.constructor == f
            c.constructor == Object
I didn’t get it…
Function.constructor == Function
JavaScript: enter the dragon
Nobody knows what to do
JavaScript: enter the dragon
http://www.udel.edu/anthro/neitzel/supplemental%20sportsS09.htm
Different goals
demand different approaches
Form always follows the function
http://www.flickr.com/photos/sgroi/3228398172/
http://en.wikipedia.org/wiki/Hercules_of_the_Forum_Boarium
JavaScript: enter the dragon
http://www.flickr.com/photos/stebbz/2451346427/
JavaScript: enter the dragon
JavaScript: enter the dragon
Thank You
“A wise man can learn more from
 a foolish question
 than a fool can learn from
 a wise answer.”
Bruce Lee
“If you spend too much time
 thinking about a thing,
 you’ll never get it done.”
 Bruce Lee

More Related Content

What's hot (20)

DOCX
Pratik Bakane C++
pratikbakane
 
ODP
Functors, applicatives, monads
rkaippully
 
DOCX
Pratik Bakane C++
pratikbakane
 
PPTX
Function basics
mohamed sikander
 
DOCX
Pratik Bakane C++
pratikbakane
 
PDF
[C++ korea] effective modern c++ study item 3 understand decltype +이동우
Seok-joon Yun
 
PDF
Stl algorithm-Basic types
mohamed sikander
 
PDF
JavaScript - Agora nervoso
Luis Vendrame
 
PDF
C++ Programming - 1st Study
Chris Ohk
 
PDF
All I know about rsc.io/c2go
Moriyoshi Koizumi
 
DOCX
Pratik Bakane C++
pratikbakane
 
PDF
Static and const members
mohamed sikander
 
PPT
Cquestions
mohamed sikander
 
PDF
Data Structures Practical File
Harjinder Singh
 
DOCX
Basic Programs of C++
Bharat Kalia
 
PDF
C++ Programming - 11th Study
Chris Ohk
 
PPTX
Introduction to Javascript
Hong Liu
 
PDF
2018 cosup-delete unused python code safely - english
Jen Yee Hong
 
PDF
ES2015 New Features
Giacomo Zinetti
 
Pratik Bakane C++
pratikbakane
 
Functors, applicatives, monads
rkaippully
 
Pratik Bakane C++
pratikbakane
 
Function basics
mohamed sikander
 
Pratik Bakane C++
pratikbakane
 
[C++ korea] effective modern c++ study item 3 understand decltype +이동우
Seok-joon Yun
 
Stl algorithm-Basic types
mohamed sikander
 
JavaScript - Agora nervoso
Luis Vendrame
 
C++ Programming - 1st Study
Chris Ohk
 
All I know about rsc.io/c2go
Moriyoshi Koizumi
 
Pratik Bakane C++
pratikbakane
 
Static and const members
mohamed sikander
 
Cquestions
mohamed sikander
 
Data Structures Practical File
Harjinder Singh
 
Basic Programs of C++
Bharat Kalia
 
C++ Programming - 11th Study
Chris Ohk
 
Introduction to Javascript
Hong Liu
 
2018 cosup-delete unused python code safely - english
Jen Yee Hong
 
ES2015 New Features
Giacomo Zinetti
 

Similar to JavaScript: enter the dragon (20)

PPT
Beginning Object-Oriented JavaScript
Stoyan Stefanov
 
PPT
JavaScript - Programming Languages course
yoavrubin
 
PPTX
Ajaxworld
deannalagason
 
PDF
JavaScript Core
François Sarradin
 
PPT
Douglas Crockford Presentation Goodparts
Ajax Experience 2009
 
PPTX
Awesomeness of JavaScript…almost
Quinton Sheppard
 
PDF
Orlando BarCamp Why Javascript Doesn't Suck
erockendude
 
PDF
JavaScript Primer
Daniel Cousineau
 
PPTX
Advanced JavaScript
Zsolt Mészárovics
 
PPT
Advanced JavaScript
Stoyan Stefanov
 
KEY
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
KEY
Javascript tid-bits
David Atchley
 
PPTX
Object Oriented JavaScript
Julie Iskander
 
PPTX
Oojs 1.1
Rodica Dada
 
PPTX
Advance JS and oop
Abuzer Firdousi
 
PDF
Js objects
anubavam-techkt
 
PDF
The many facets of code reuse in JavaScript
Leonardo Borges
 
PPTX
Typescript barcelona
Christoffer Noring
 
PPT
JavaScript Needn't Hurt!
Thomas Kjeldahl Nilsson
 
PDF
Java script object model
James Hsieh
 
Beginning Object-Oriented JavaScript
Stoyan Stefanov
 
JavaScript - Programming Languages course
yoavrubin
 
Ajaxworld
deannalagason
 
JavaScript Core
François Sarradin
 
Douglas Crockford Presentation Goodparts
Ajax Experience 2009
 
Awesomeness of JavaScript…almost
Quinton Sheppard
 
Orlando BarCamp Why Javascript Doesn't Suck
erockendude
 
JavaScript Primer
Daniel Cousineau
 
Advanced JavaScript
Zsolt Mészárovics
 
Advanced JavaScript
Stoyan Stefanov
 
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
Javascript tid-bits
David Atchley
 
Object Oriented JavaScript
Julie Iskander
 
Oojs 1.1
Rodica Dada
 
Advance JS and oop
Abuzer Firdousi
 
Js objects
anubavam-techkt
 
The many facets of code reuse in JavaScript
Leonardo Borges
 
Typescript barcelona
Christoffer Noring
 
JavaScript Needn't Hurt!
Thomas Kjeldahl Nilsson
 
Java script object model
James Hsieh
 
Ad

More from Dmitry Baranovskiy (14)

PDF
The Origins of Magic
Dmitry Baranovskiy
 
PDF
Raphaël
Dmitry Baranovskiy
 
PDF
Type Recognition
Dmitry Baranovskiy
 
PDF
Raphaël JS Conf
Dmitry Baranovskiy
 
PDF
Obvious Secrets of JavaScript
Dmitry Baranovskiy
 
PDF
Your JavaScript Library
Dmitry Baranovskiy
 
PDF
Java Script Workshop
Dmitry Baranovskiy
 
PDF
Raphael
Dmitry Baranovskiy
 
PDF
Web Vector Graphics
Dmitry Baranovskiy
 
PDF
Typography on the Web
Dmitry Baranovskiy
 
PDF
Microformats—the hidden treasure
Dmitry Baranovskiy
 
PDF
Advanced JavaScript Techniques
Dmitry Baranovskiy
 
The Origins of Magic
Dmitry Baranovskiy
 
Type Recognition
Dmitry Baranovskiy
 
Raphaël JS Conf
Dmitry Baranovskiy
 
Obvious Secrets of JavaScript
Dmitry Baranovskiy
 
Your JavaScript Library
Dmitry Baranovskiy
 
Java Script Workshop
Dmitry Baranovskiy
 
Web Vector Graphics
Dmitry Baranovskiy
 
Typography on the Web
Dmitry Baranovskiy
 
Microformats—the hidden treasure
Dmitry Baranovskiy
 
Advanced JavaScript Techniques
Dmitry Baranovskiy
 
Ad

Recently uploaded (20)

PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
July Patch Tuesday
Ivanti
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 

JavaScript: enter the dragon