SlideShare a Scribd company logo
1 of 100
Download to read offline
JavaScript
Like a Box of Chocolates
“Are you telling me that I can’t get away
anymore without getting deeply into Javascript?”

                                         - Developer
“That is a disaster for me! I have made a career
out of actively avoiding Javascript.”

                                         - Developer
“If I cant continue to ignore Javascript, then you
may as well amputate one of my limbs.”

                                           - Developer
// Variable declaration
var firstName = "Forrest";

// Function declaration
function saying () {
    return "Stupid is as stupid does";
}
// If statement
if (badGrades) {
    return "Mom sleeps with teacher";
}

// Switch statement
var age = 10,
    lifeState;
switch (age) {
    case 10:
        lifeState = "Young";
        break;
    case 60:
        lifeState = "Old";
        break;
}
// Object literal
var forrest = {
    firstName : "Forrest"
};

// Array literal
var forrestFriends = ["Bubba", "Lieutenant Dan"];
// Shorthand assignment
function (boxOfChocolates) {
    var life = boxOfChocolates || "Snickers bar";
}

// Ternary operators
(looking)? "I gotta find Bubba!" : "It's ok";
// Short-circuit logic
if (obj && obj.property) {
    obj.property = "Lieutenant Dan, I got you some ice cream";
}
string
number
boolean
null
undefined
object
Array
string
           Date
number
           function
boolean
           RegExp
null
undefined
object
// Variable declaration
var firstName = "Forrest";

// Function declaration
function party () {
    return "Stupid is as stupid does";
}

typeof firstName // string
typeof party // function
// Object declaration
var forrest = {
    firstName : "Forrest"
};

// Array declaration
var forrestFriends = ["Bubba", "Lieutenant Dan"];



typeof forrest // object
typeof forrestFriends // object
// Object declaration
var forrest = {
    firstName : "Forrest"
};

// Array declaration
var forrestFriends = ["Bubba", "Lieutenant Dan"];


forrest forrest // object // false
 typeof instanceof Array
forrestFriends instanceof object // true
 typeof forrestFriends // Array
// Various "false" values
var nullVal = null;
var undefinedVal = undefined;
var zeroVal = 0;
var falseVal = false;
var emptyString = "";

// All would equal false in an if-clause
if (emptyString) {
    // Would never go in here
}
“Coercion is the practice of forcing another party
to behave in an involuntary manner”

                                          - Wikipedia
// Assignment
var happy = true;

// Equality
if (7 == "7") {
    // true
}

// Identity
if (7 === "7") {
    // false
}
// Assignment
                               rci on
                             oe
var happy = true;
                           c
// Equality        Ty pe
if (7 == "7") {
    // true
}

// Identity
if (7 === "7") {
    // false
}
// Type coercion
var sum = "5" + 6 + 7; // 567
// Prevent type coercion
var sum = parseInt("5", 10) + 6 + 7; // 18
// Self-invoking functions
(function () {
    var investment = "Lieutenant Dan got me
invested in some kind of fruit company.";
})();
// Using arguments
function friends (friend1, friend2) {
    return friend1 + " & " + friend2;
}

// Lieutenant Dan & Bubba
friends("Lieutenant Dan", "Bubba");

// Lieutenant Dan & undefined
friends("Lieutenant Dan");
// Using the arguments collection
function friends () {
    var allFriends = [];
    for (var i=0, il=arguments.length; i<il; i++) {
        allFriends.push(arguments[i]);
    };
    return allFriends.join(" & ");
}

// Lieutenant Dan & Bubba
friends("Lieutenant Dan", "Bubba");

// Lieutenant Dan
friends("Lieutenant Dan");
// Object declaration
function Forrest () {
    this.firstName = "Forrest";
    this.lastName = "Gump";
}

var forrest = new Forrest();
// Object declaration, literal style
var forrest = {
    firstName : "Forrest",
    lastName : "Gump"
};
// Iterating over properties
for (var item in forrest) {
     console.log(item + ": " + forrest[item]);
}
// Object declaration
var forrest = {
    firstName : "Forrest"
};

// Safe check for property
if ("firstName" in forrest) {
    console.log(forrest.firstName);
}
// Object declaration
function ForrestAsChild {
    this.firstName = "Forrest";
};

// Method set via prototype
ForrestAsChild.prototype.runsFast = function () {
    return true;
};
// Object declaration
function ForrestAsGrownup {
    this.joinsArmy = true;
};

// Prototype for new object
ForrestAsGrownup.prototype = new ForrestAsChild;

// Method set via prototype
ForrestAsGrownup.prototype.ruinsBathrobe = function () {
    return "I think I ruined your roommate's bathrobe";
};
// Create an instance
var forrest = new ForrestAsGrownup();

// Returns "I think I ruined your roommate's bathrobe"
forrest.ruinsBathrobe();

// Returns true - from ForrestAsChild
forrest.runsFast();

// Fails
forrest.codesJavaScript();
forrest instance

ForrestAsGrownup

ForrestAsChild

Object
// Extending core JavaScript objects
if (typeof Array.prototype.push === "undefined") {
    Array.prototype.push = function () {
        for (var i=0, il=arguments.length; i<il; i++) {
            this[this.length] = arguments[i];
        };
        return this;
    }
}



var locations = ["Vietnam"];
locations.push("China", "White House");
// locations = ["Vietnam", "China", "White House"];
// Scope - global or local

// Global
var quote = "I had run for 3 years, 2 months,
14 days, and 16 hours."

function () {
    // Local
    var pantherParty = "I'm sorry I had to
fight in the middle of your Black Panther
party.";

    // Global
    question = "And so, you just ran?";
}
// Global
function meetingJFK () {
    var JFKQuestion = "Congratulations, how do
you feel?";

    // Local
    function forrestReply () {
        return "I gotta pee.";
    }

    return forrestReply();
}

meetingJFK(); // I gotta pee
forrestReply(); // Error: not accessible
// Controlling scope
function whoAmI () {
    return this.nodeName;
}

whoAmI(); // undefined
whoAmI.call(document, "Hello"); // #document
whoAmI.apply(document.body, ["Hello", "Greetings?"]); // BODY
// closures
function happens (what) {
    return function (verb) {
        return what + " " + verb;
    }
}

var action = happens("Shit");

action("happens"); // Shit happens
// closures
function happens (what) {
    return function (verb) {
        return what + " " + verb;
    }
}

var action = happens("Shit");

// Breaking it down
var action = function (verb) {
    return "Shit" + " " + verb;
};
// closures
function happens (what) {
    return function (verb) {
        return what + " " + verb;
    }
}

var action = happens("Shit");

// Breaking it down
var action = function (verb) {
    return "Shit" + " " + verb;
};
var link;
for (var i=0; i<3; i++) {
    link = document.createElement("a");
    link.innerHTML = "Link " + i;
    link.onclick = function () {
        alert("I am link " + i);
    };
    document.body.appendChild(link);
};
var link;
for (var i=0; i<3; i++) {
    link = document.createElement("a");
    link.innerHTML = "Link " + i;
    link.onclick = function (index) {
        return function () {
            alert("I am link " + index);
        };
    }(i);
    document.body.appendChild(link);
};
var link;
for (var i=0; i<3; i++) {
    link = document.createElement("a");
    link.innerHTML = "Link " + i;
    link.onclick = function (index) {
        return function () {
            alert("I am link " + index);
        };
    }(i);
    document.body.appendChild(link);
};
var link;
for (var i=0; i<3; i++) {
    link = document.createElement("a");
    link.innerHTML = "Link " + i;
    link.onclick = function (index) {
        return function () {
            alert("I am link " + index);
        };
    }(i);
    document.body.appendChild(link);
};
var link;
for (var i=0; i<3; i++) {
    link = document.createElement("a");
    link.innerHTML = "Link " + i;
    link.onclick = function (index) {
        return function () {
            alert("I am link " + index);
        };
    }(i);
    document.body.appendChild(link);
};
// Yahoo! JavaScript Module Pattern
var forrest = function () {
    var firstName = "Forrest";

       return {
           getFirstName : function () {
                return firstName;
           }
       };
}();

// Returns "Forrest"
forrest.getFirstName();
// Yahoo! JavaScript Module Pattern
var forrest = function () {
    var firstName = "Forrest",
        getFirstName = function () {
            return firstName;
        };

       return {
           getFirstName : getFirstName
       };
}();

// Returns "Forrest"
forrest.getFirstName();
// Namespacing
var Movie = {};

// Yahoo! JavaScript Module Pattern
Movie.forrest = function () {
    var lastName = "Gump";

       return {
           firstName : "Forrest",
           getFirstName : function () {
                return this.firstName;
           }
       };
}();
// Yahoo! JavaScript Module Pattern
Movie.forrest = function () {
    var lastName = "Gump";

       return {
           firstName : "Forrest",
           getFirstName : function () {
                return this.firstName;
           }
       };
}();



// Yahoo! JavaScript Module Pattern
Movie.lieutenantDan = function () {
    var lastName = "Taylor";

       return {
           firstName : "Dan",
           getFullName : function () {
                return Movie.forrest.getFirstName.call(this) + " " + lastName;
           }
       };
}();

Movie.lieutenantDan.getFullName();
// Yahoo! JavaScript Module Pattern
Movie.forrest = function () {
    var lastName = "Gump";

       return {
           firstName : "Forrest",
           getFirstName : function () {
                return this.firstName;
           }
       };
}();



// Yahoo! JavaScript Module Pattern
Movie.lieutenantDan = function () {
    var lastName = "Taylor";

       return {
           firstName : "Dan",
           getFullName : function () {
                return Movie.forrest.getFirstName.call(this) + " " + lastName;
           }
       };
}();

Movie.lieutenantDan.getFullName();
// Minimize DOM access
document.getElementById("container").className = "js-enabled";
document.getElementById("container").innerHTML += "Hello Amsterdam";
document.getElementById("container").innerHTML += "Tell me how you doin'!";
document.getElementById("container").innerHTML += "I went on a nice boat
                                                   ride last night!";
document.getElementById("container").innerHTML += "...where Carrot Top made
                                                   a pass at me...";
// Minimize DOM access
var container = document.getElementById("container"),
    content = "Hello Amsterdam";
container.className = "js-enabled";
content += "Tell me how you doin'!";
content += "I went on a nice boat ride last night!";
content += "...where Carrot Top made a pass at me...";
container.innerHTML = content;
// Minimize DOM access
var container = document.getElementById("container"),
    content = "Hello Amsterdam";
container.className = "js-enabled";
content += "Tell me how you doin'!";
content += "I went on a nice boat ride last night!";
content += "...where Carrot Top made a pass at me...";
container.innerHTML = content;
// Variable declaration
function richAndStupid () {
    var rich = "And cause I was a gazillionaire, I
cut that grass for free.",
        stupid = "Stupid is as stupid does.";
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0; i<allParagraphs.length; i++) {
        var link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        allParagraphs[i].className = "Forrested";
        allParagraphs[i].appendChild(link);
    }
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0; i<allParagraphs.length; i++) {
        var link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        allParagraphs[i].className = "Forrested";
        allParagraphs[i].appendChild(link);
    }
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0; i<allParagraphs.length; i++) {
        var link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        allParagraphs[i].className = "Forrested";
        allParagraphs[i].appendChild(link);
    }
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0; i<allParagraphs.length; i++) {
        var link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        allParagraphs[i].className = "Forrested";
        allParagraphs[i].appendChild(link);
    }
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) {
        link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        paragraph = allParagraphs[i];
        paragraph.className = "Forrested";
        paragraph.appendChild(link);
    }
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) {
        link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        paragraph = allParagraphs[i];
        paragraph.className = "Forrested";
        paragraph.appendChild(link);
    }
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) {
        link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        paragraph = allParagraphs[i];
        paragraph.className = "Forrested";
        paragraph.appendChild(link);
    }
}
// Looping, variables and array lookups
function forrestForm () {
    var allParagraphs = document.getElementsByTagName("p");
    for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) {
        link = document.createElement("a");
        link.href = "http://en.wikipedia.org/wiki/Forrest_Gump";
        link.title = "Read about Forrest Gump at Wikipedia";
        link.innerHTML = "Forrest Gump";

        paragraph = allParagraphs[i];
        paragraph.className = "Forrested";
        paragraph.appendChild(link);
    }
}
// Semicolon insertion
return
{
    javascript : "Fantastic!"
};
// Semicolon insertion
return; // Semicolon insertion
{ // Considered an empty block
    javascript : "Fantastic!"
}; // Semicolon insertion, dummy line
JSLint
Robert Nyman
                                                              http://robertnyman.com/speaking/

                                                                                Twitter: @robertnyman



Pictures:

Ninja Turtle: http://www.originalprop.com/blog/2008/03/20/teenage-mutant-ninja-turtles-costume-restoration/     Dog (Cat): http://www.cartoonstock.com/directory/f/false_identity.asp
Bruce Willis: http://www.starsjournal.com/3192/bruce-willis-is-being-sued-for-4-million-dollars.html            Hillary Clinton & Soldier: http://confederateyankee.mu.nu/archives/154032.php
Swedish flag: http://www.olssonfoto.se/JAlbum/SGP%202008%20Ullevi/slides/Svenska%20flaggan.html                   Play with yourself: http://www.justwhatshesaid.com/?p=965
Euro Coin: http://accidentaldong.blogspot.com/2009/10/euro-uh-oh.html                                           Overloading: http://theshadowhive.blogspot.com/2010/04/mutating-chaos-gene.html
                                                                                                                Brad Pitt: http://open.salon.com/blog/just-walt/2009/10/29/real_men_he-men_pictures_whos_the_manliest_of_men
                                                                                                                Kristen Bell: http://veronica-mars-episodes.download-tvshows.com/kristen-bell-loves-megan-fox/
Most popular language: http://odetocode.com/Blogs/scott/archive/2009/03/18/signs-that-your-javascript-skills-   Extensible table: http://www.amishshowroom.com/index.php?main_page=index&cPath=40_64
need-updating.aspx                                                                                              Tiger Woods: http://blogs.bigadda.com/pal4868546/2010/01/
Sunrise: http://www.manywallpapers.com/space-wallpapers/earth/sunrise-from-space.html                           Pollution: http://blog.lib.umn.edu/cramb005/architecture/
Astronaut: http://martianchronicles.wordpress.com/2009/01/23/carnival-of-space-87/                              Closure: http://today.msnbc.msn.com/id/4760120
Netscape 2: http://blog.explorelearning.com/2005/12/index.html                                                  Steve Ballmer: http://www.businessinsider.com/microsoft-completely-rebooted-its-mobile-strategy-yesterday-heres-
Internet Explorer 3: http://www.guidebookgallery.org/screenshots/browser                                        what-you-missed-2010-2
Gandalf: http://web.mit.edu/kayla/Public/Backgrounds/LOTR%20Gandalf%204.JPG                                     Inheritance: http://tithebarn.wordpress.com/2010/04/26/the-meek-shall-inherit-if-thats-alright-with-the-rest-of-you/
Now: http://www.geekologie.com/2007/07/15-week/                                                                 Crockford: http://gemsres.com/story/nov07/468365/Crockford_New_4681.jpg
Axe: http://bestgamewallpapers.com/a3-the-age-of-sovereign/axe                                                  Name: http://blog.usa.gov/roller/govgab/tags/names
Time: http://www.mindhacks.com/blog/seeing/index.html                                                           Space: http://gucken.deviantart.com/art/Sunrise-in-Space-56420137
Money: http://www.mediabistro.com/unbeige/ideas/                                                                Fail better: http://ozguralaz.posterous.com/ever-tried-ever-failed-no-matt
Happy Ape: http://thesituationist.wordpress.com/2007/06/14/
High speed train: http://www.freefoto.com/preview/23-22-1?ffid=23-22-1                                           Mila & Macaulay: http://uk.eonline.com/uberblog/b61889_mila_macaulay_home_alone.html
Sunspider results: http://ie.microsoft.com/testdrive/benchmarks/sunspider/default.html                          Hearts: http://www.funonthenet.in/content/view/395/31/
Forrest Gump: http://wallpaper-s.org/36__Forrest_Gump,_1994,_Tom_Hanks,_Robin_Wright_Penn.htm
Data: http://walrus.wr.usgs.gov/infobank/programs/html/definition/datadictionary.html
JavaScript - Like a Box of Chocolates

More Related Content

What's hot

Monads asking the right question
Monads  asking the right questionMonads  asking the right question
Monads asking the right questionPawel Szulc
 
Coffeescript: No really, it's just Javascript
Coffeescript: No really, it's just JavascriptCoffeescript: No really, it's just Javascript
Coffeescript: No really, it's just JavascriptBrian Mann
 
Java Puzzlers NG as it was presented at Detroit Java User Group
Java Puzzlers NG as it was presented at Detroit Java User GroupJava Puzzlers NG as it was presented at Detroit Java User Group
Java Puzzlers NG as it was presented at Detroit Java User GroupBaruch Sadogursky
 
#SPUG - Legacy applications
#SPUG - Legacy applications#SPUG - Legacy applications
#SPUG - Legacy applicationsPiotr Pasich
 
Ember background basics
Ember background basicsEmber background basics
Ember background basicsPhilipp Fehre
 
Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr PasichPiotr Pasich
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to djangoswee meng ng
 
Functional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenFunctional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenPawel Szulc
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcionalNSCoder Mexico
 
Counting on God
Counting on GodCounting on God
Counting on GodJames Gray
 
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2Federico Galassi
 
The report of JavaOne2011 about groovy
The report of JavaOne2011 about groovyThe report of JavaOne2011 about groovy
The report of JavaOne2011 about groovyYasuharu Nakano
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KThomas Fuchs
 

What's hot (20)

JavaScript Patterns
JavaScript PatternsJavaScript Patterns
JavaScript Patterns
 
Monads asking the right question
Monads  asking the right questionMonads  asking the right question
Monads asking the right question
 
dojo.things()
dojo.things()dojo.things()
dojo.things()
 
Coffeescript: No really, it's just Javascript
Coffeescript: No really, it's just JavascriptCoffeescript: No really, it's just Javascript
Coffeescript: No really, it's just Javascript
 
has("builds")
has("builds")has("builds")
has("builds")
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
Java Puzzlers NG as it was presented at Detroit Java User Group
Java Puzzlers NG as it was presented at Detroit Java User GroupJava Puzzlers NG as it was presented at Detroit Java User Group
Java Puzzlers NG as it was presented at Detroit Java User Group
 
#SPUG - Legacy applications
#SPUG - Legacy applications#SPUG - Legacy applications
#SPUG - Legacy applications
 
Ember background basics
Ember background basicsEmber background basics
Ember background basics
 
Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr Pasich
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to django
 
Functional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenFunctional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heaven
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcional
 
Counting on God
Counting on GodCounting on God
Counting on God
 
Symfony2 meets propel 1.5
Symfony2 meets propel 1.5Symfony2 meets propel 1.5
Symfony2 meets propel 1.5
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2
 
The report of JavaOne2011 about groovy
The report of JavaOne2011 about groovyThe report of JavaOne2011 about groovy
The report of JavaOne2011 about groovy
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 

Viewers also liked

The prestige of being a web developer (no notes)
The prestige of being a web developer (no notes)The prestige of being a web developer (no notes)
The prestige of being a web developer (no notes)Christian Heilmann
 
Yi Yang_Resume
Yi Yang_ResumeYi Yang_Resume
Yi Yang_ResumeYi Yang
 
2016_Jan_Resume_Lyra
2016_Jan_Resume_Lyra2016_Jan_Resume_Lyra
2016_Jan_Resume_Lyra敏宽 晏
 
Zhen li Resume
Zhen li ResumeZhen li Resume
Zhen li ResumeZhen Li
 

Viewers also liked (6)

The prestige of being a web developer (no notes)
The prestige of being a web developer (no notes)The prestige of being a web developer (no notes)
The prestige of being a web developer (no notes)
 
Yi Yang_Resume
Yi Yang_ResumeYi Yang_Resume
Yi Yang_Resume
 
2016_Jan_Resume_Lyra
2016_Jan_Resume_Lyra2016_Jan_Resume_Lyra
2016_Jan_Resume_Lyra
 
Resume_CS
Resume_CSResume_CS
Resume_CS
 
Huu Bang's Résumé
Huu Bang's RésuméHuu Bang's Résumé
Huu Bang's Résumé
 
Zhen li Resume
Zhen li ResumeZhen li Resume
Zhen li Resume
 

Similar to JavaScript - Like a Box of Chocolates

JavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDayJavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDayRobert Nyman
 
JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)Robert Nyman
 
JavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldJavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldRobert Nyman
 
Intro to Advanced JavaScript
Intro to Advanced JavaScriptIntro to Advanced JavaScript
Intro to Advanced JavaScriptryanstout
 
Web Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for PerformanceWeb Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for Performancejohndaviddalton
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
jQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journeyjQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journeyHuiyi Yan
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oopLearningTech
 
HTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranHTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranRobert Nyman
 
JavaScript Classes and Inheritance
JavaScript Classes and InheritanceJavaScript Classes and Inheritance
JavaScript Classes and Inheritancemarcheiligers
 
JSConf: All You Can Leet
JSConf: All You Can LeetJSConf: All You Can Leet
JSConf: All You Can Leetjohndaviddalton
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Seri Moth
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developersStoyan Stefanov
 
Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Tomasz Dziuda
 
Object-oriented Javascript
Object-oriented JavascriptObject-oriented Javascript
Object-oriented JavascriptDaniel Ku
 
Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015Lukas Ruebbelke
 

Similar to JavaScript - Like a Box of Chocolates (20)

JavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDayJavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDay
 
JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)
 
JavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldJavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New World
 
Intro to Advanced JavaScript
Intro to Advanced JavaScriptIntro to Advanced JavaScript
Intro to Advanced JavaScript
 
Web Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for PerformanceWeb Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for Performance
 
JavaScript patterns
JavaScript patternsJavaScript patterns
JavaScript patterns
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
jQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journeyjQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journey
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oop
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
HTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranHTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - Altran
 
JavaScript Classes and Inheritance
JavaScript Classes and InheritanceJavaScript Classes and Inheritance
JavaScript Classes and Inheritance
 
JSConf: All You Can Leet
JSConf: All You Can LeetJSConf: All You Can Leet
JSConf: All You Can Leet
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
 
Txjs
TxjsTxjs
Txjs
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developers
 
Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Introduction to ECMAScript 2015
Introduction to ECMAScript 2015
 
Object-oriented Javascript
Object-oriented JavascriptObject-oriented Javascript
Object-oriented Javascript
 
Wakanday JS201 Best Practices
Wakanday JS201 Best PracticesWakanday JS201 Best Practices
Wakanday JS201 Best Practices
 
Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015
 

More from Robert Nyman

Have you tried listening?
Have you tried listening?Have you tried listening?
Have you tried listening?Robert Nyman
 
Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017Robert Nyman
 
Introduction to Google Daydream
Introduction to Google DaydreamIntroduction to Google Daydream
Introduction to Google DaydreamRobert Nyman
 
Predictability for the Web
Predictability for the WebPredictability for the Web
Predictability for the WebRobert Nyman
 
The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016Robert Nyman
 
The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016Robert Nyman
 
The Future of Progressive Web Apps - Google for Indonesia
The Future of Progressive Web Apps - Google for IndonesiaThe Future of Progressive Web Apps - Google for Indonesia
The Future of Progressive Web Apps - Google for IndonesiaRobert Nyman
 
Google tech & products
Google tech & productsGoogle tech & products
Google tech & productsRobert Nyman
 
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...Robert Nyman
 
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
Progressive Web Apps keynote, Google Developer Summit, Tokyo, JapanProgressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
Progressive Web Apps keynote, Google Developer Summit, Tokyo, JapanRobert Nyman
 
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...Robert Nyman
 
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...Robert Nyman
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulRobert Nyman
 
The web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must goThe web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must goRobert Nyman
 
Google, the future and possibilities
Google, the future and possibilitiesGoogle, the future and possibilities
Google, the future and possibilitiesRobert Nyman
 
Developer Relations in the Nordics
Developer Relations in the NordicsDeveloper Relations in the Nordics
Developer Relations in the NordicsRobert Nyman
 
What is Developer Relations?
What is Developer Relations?What is Developer Relations?
What is Developer Relations?Robert Nyman
 
Android TV Introduction - Stockholm Android TV meetup
Android TV Introduction - Stockholm Android TV meetupAndroid TV Introduction - Stockholm Android TV meetup
Android TV Introduction - Stockholm Android TV meetupRobert Nyman
 
New improvements for web developers - frontend.fi, Helsinki
New improvements for web developers - frontend.fi, HelsinkiNew improvements for web developers - frontend.fi, Helsinki
New improvements for web developers - frontend.fi, HelsinkiRobert Nyman
 
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, HelsinkiMobile phone trends, user data & developer climate - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, HelsinkiRobert Nyman
 

More from Robert Nyman (20)

Have you tried listening?
Have you tried listening?Have you tried listening?
Have you tried listening?
 
Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017
 
Introduction to Google Daydream
Introduction to Google DaydreamIntroduction to Google Daydream
Introduction to Google Daydream
 
Predictability for the Web
Predictability for the WebPredictability for the Web
Predictability for the Web
 
The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016
 
The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016
 
The Future of Progressive Web Apps - Google for Indonesia
The Future of Progressive Web Apps - Google for IndonesiaThe Future of Progressive Web Apps - Google for Indonesia
The Future of Progressive Web Apps - Google for Indonesia
 
Google tech & products
Google tech & productsGoogle tech & products
Google tech & products
 
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
 
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
Progressive Web Apps keynote, Google Developer Summit, Tokyo, JapanProgressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
 
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...
 
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - Istanbul
 
The web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must goThe web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must go
 
Google, the future and possibilities
Google, the future and possibilitiesGoogle, the future and possibilities
Google, the future and possibilities
 
Developer Relations in the Nordics
Developer Relations in the NordicsDeveloper Relations in the Nordics
Developer Relations in the Nordics
 
What is Developer Relations?
What is Developer Relations?What is Developer Relations?
What is Developer Relations?
 
Android TV Introduction - Stockholm Android TV meetup
Android TV Introduction - Stockholm Android TV meetupAndroid TV Introduction - Stockholm Android TV meetup
Android TV Introduction - Stockholm Android TV meetup
 
New improvements for web developers - frontend.fi, Helsinki
New improvements for web developers - frontend.fi, HelsinkiNew improvements for web developers - frontend.fi, Helsinki
New improvements for web developers - frontend.fi, Helsinki
 
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, HelsinkiMobile phone trends, user data & developer climate - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki
 

Recently uploaded

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
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
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
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
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

JavaScript - Like a Box of Chocolates

  • 1. JavaScript Like a Box of Chocolates
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. “Are you telling me that I can’t get away anymore without getting deeply into Javascript?” - Developer
  • 16. “That is a disaster for me! I have made a career out of actively avoiding Javascript.” - Developer
  • 17. “If I cant continue to ignore Javascript, then you may as well amputate one of my limbs.” - Developer
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. // Variable declaration var firstName = "Forrest"; // Function declaration function saying () { return "Stupid is as stupid does"; }
  • 25. // If statement if (badGrades) { return "Mom sleeps with teacher"; } // Switch statement var age = 10, lifeState; switch (age) { case 10: lifeState = "Young"; break; case 60: lifeState = "Old"; break; }
  • 26. // Object literal var forrest = { firstName : "Forrest" }; // Array literal var forrestFriends = ["Bubba", "Lieutenant Dan"];
  • 27. // Shorthand assignment function (boxOfChocolates) { var life = boxOfChocolates || "Snickers bar"; } // Ternary operators (looking)? "I gotta find Bubba!" : "It's ok";
  • 28. // Short-circuit logic if (obj && obj.property) { obj.property = "Lieutenant Dan, I got you some ice cream"; }
  • 29.
  • 31. Array string Date number function boolean RegExp null undefined object
  • 32. // Variable declaration var firstName = "Forrest"; // Function declaration function party () { return "Stupid is as stupid does"; } typeof firstName // string typeof party // function
  • 33. // Object declaration var forrest = { firstName : "Forrest" }; // Array declaration var forrestFriends = ["Bubba", "Lieutenant Dan"]; typeof forrest // object typeof forrestFriends // object
  • 34. // Object declaration var forrest = { firstName : "Forrest" }; // Array declaration var forrestFriends = ["Bubba", "Lieutenant Dan"]; forrest forrest // object // false typeof instanceof Array forrestFriends instanceof object // true typeof forrestFriends // Array
  • 35.
  • 36. // Various "false" values var nullVal = null; var undefinedVal = undefined; var zeroVal = 0; var falseVal = false; var emptyString = ""; // All would equal false in an if-clause if (emptyString) { // Would never go in here }
  • 37.
  • 38. “Coercion is the practice of forcing another party to behave in an involuntary manner” - Wikipedia
  • 39. // Assignment var happy = true; // Equality if (7 == "7") { // true } // Identity if (7 === "7") { // false }
  • 40. // Assignment rci on oe var happy = true; c // Equality Ty pe if (7 == "7") { // true } // Identity if (7 === "7") { // false }
  • 41. // Type coercion var sum = "5" + 6 + 7; // 567
  • 42. // Prevent type coercion var sum = parseInt("5", 10) + 6 + 7; // 18
  • 43.
  • 44. // Self-invoking functions (function () { var investment = "Lieutenant Dan got me invested in some kind of fruit company."; })();
  • 45.
  • 46. // Using arguments function friends (friend1, friend2) { return friend1 + " & " + friend2; } // Lieutenant Dan & Bubba friends("Lieutenant Dan", "Bubba"); // Lieutenant Dan & undefined friends("Lieutenant Dan");
  • 47. // Using the arguments collection function friends () { var allFriends = []; for (var i=0, il=arguments.length; i<il; i++) { allFriends.push(arguments[i]); }; return allFriends.join(" & "); } // Lieutenant Dan & Bubba friends("Lieutenant Dan", "Bubba"); // Lieutenant Dan friends("Lieutenant Dan");
  • 48.
  • 49. // Object declaration function Forrest () { this.firstName = "Forrest"; this.lastName = "Gump"; } var forrest = new Forrest();
  • 50. // Object declaration, literal style var forrest = { firstName : "Forrest", lastName : "Gump" };
  • 51. // Iterating over properties for (var item in forrest) { console.log(item + ": " + forrest[item]); }
  • 52. // Object declaration var forrest = { firstName : "Forrest" }; // Safe check for property if ("firstName" in forrest) { console.log(forrest.firstName); }
  • 53.
  • 54. // Object declaration function ForrestAsChild { this.firstName = "Forrest"; }; // Method set via prototype ForrestAsChild.prototype.runsFast = function () { return true; };
  • 55. // Object declaration function ForrestAsGrownup { this.joinsArmy = true; }; // Prototype for new object ForrestAsGrownup.prototype = new ForrestAsChild; // Method set via prototype ForrestAsGrownup.prototype.ruinsBathrobe = function () { return "I think I ruined your roommate's bathrobe"; };
  • 56. // Create an instance var forrest = new ForrestAsGrownup(); // Returns "I think I ruined your roommate's bathrobe" forrest.ruinsBathrobe(); // Returns true - from ForrestAsChild forrest.runsFast(); // Fails forrest.codesJavaScript();
  • 58.
  • 59. // Extending core JavaScript objects if (typeof Array.prototype.push === "undefined") { Array.prototype.push = function () { for (var i=0, il=arguments.length; i<il; i++) { this[this.length] = arguments[i]; }; return this; } } var locations = ["Vietnam"]; locations.push("China", "White House"); // locations = ["Vietnam", "China", "White House"];
  • 60.
  • 61. // Scope - global or local // Global var quote = "I had run for 3 years, 2 months, 14 days, and 16 hours." function () { // Local var pantherParty = "I'm sorry I had to fight in the middle of your Black Panther party."; // Global question = "And so, you just ran?"; }
  • 62. // Global function meetingJFK () { var JFKQuestion = "Congratulations, how do you feel?"; // Local function forrestReply () { return "I gotta pee."; } return forrestReply(); } meetingJFK(); // I gotta pee forrestReply(); // Error: not accessible
  • 63. // Controlling scope function whoAmI () { return this.nodeName; } whoAmI(); // undefined whoAmI.call(document, "Hello"); // #document whoAmI.apply(document.body, ["Hello", "Greetings?"]); // BODY
  • 64.
  • 65.
  • 66. // closures function happens (what) { return function (verb) { return what + " " + verb; } } var action = happens("Shit"); action("happens"); // Shit happens
  • 67.
  • 68. // closures function happens (what) { return function (verb) { return what + " " + verb; } } var action = happens("Shit"); // Breaking it down var action = function (verb) { return "Shit" + " " + verb; };
  • 69. // closures function happens (what) { return function (verb) { return what + " " + verb; } } var action = happens("Shit"); // Breaking it down var action = function (verb) { return "Shit" + " " + verb; };
  • 70. var link; for (var i=0; i<3; i++) { link = document.createElement("a"); link.innerHTML = "Link " + i; link.onclick = function () { alert("I am link " + i); }; document.body.appendChild(link); };
  • 71. var link; for (var i=0; i<3; i++) { link = document.createElement("a"); link.innerHTML = "Link " + i; link.onclick = function (index) { return function () { alert("I am link " + index); }; }(i); document.body.appendChild(link); };
  • 72. var link; for (var i=0; i<3; i++) { link = document.createElement("a"); link.innerHTML = "Link " + i; link.onclick = function (index) { return function () { alert("I am link " + index); }; }(i); document.body.appendChild(link); };
  • 73. var link; for (var i=0; i<3; i++) { link = document.createElement("a"); link.innerHTML = "Link " + i; link.onclick = function (index) { return function () { alert("I am link " + index); }; }(i); document.body.appendChild(link); };
  • 74. var link; for (var i=0; i<3; i++) { link = document.createElement("a"); link.innerHTML = "Link " + i; link.onclick = function (index) { return function () { alert("I am link " + index); }; }(i); document.body.appendChild(link); };
  • 75.
  • 76. // Yahoo! JavaScript Module Pattern var forrest = function () { var firstName = "Forrest"; return { getFirstName : function () { return firstName; } }; }(); // Returns "Forrest" forrest.getFirstName();
  • 77. // Yahoo! JavaScript Module Pattern var forrest = function () { var firstName = "Forrest", getFirstName = function () { return firstName; }; return { getFirstName : getFirstName }; }(); // Returns "Forrest" forrest.getFirstName();
  • 78.
  • 79. // Namespacing var Movie = {}; // Yahoo! JavaScript Module Pattern Movie.forrest = function () { var lastName = "Gump"; return { firstName : "Forrest", getFirstName : function () { return this.firstName; } }; }();
  • 80. // Yahoo! JavaScript Module Pattern Movie.forrest = function () { var lastName = "Gump"; return { firstName : "Forrest", getFirstName : function () { return this.firstName; } }; }(); // Yahoo! JavaScript Module Pattern Movie.lieutenantDan = function () { var lastName = "Taylor"; return { firstName : "Dan", getFullName : function () { return Movie.forrest.getFirstName.call(this) + " " + lastName; } }; }(); Movie.lieutenantDan.getFullName();
  • 81. // Yahoo! JavaScript Module Pattern Movie.forrest = function () { var lastName = "Gump"; return { firstName : "Forrest", getFirstName : function () { return this.firstName; } }; }(); // Yahoo! JavaScript Module Pattern Movie.lieutenantDan = function () { var lastName = "Taylor"; return { firstName : "Dan", getFullName : function () { return Movie.forrest.getFirstName.call(this) + " " + lastName; } }; }(); Movie.lieutenantDan.getFullName();
  • 82.
  • 83. // Minimize DOM access document.getElementById("container").className = "js-enabled"; document.getElementById("container").innerHTML += "Hello Amsterdam"; document.getElementById("container").innerHTML += "Tell me how you doin'!"; document.getElementById("container").innerHTML += "I went on a nice boat ride last night!"; document.getElementById("container").innerHTML += "...where Carrot Top made a pass at me...";
  • 84. // Minimize DOM access var container = document.getElementById("container"), content = "Hello Amsterdam"; container.className = "js-enabled"; content += "Tell me how you doin'!"; content += "I went on a nice boat ride last night!"; content += "...where Carrot Top made a pass at me..."; container.innerHTML = content;
  • 85. // Minimize DOM access var container = document.getElementById("container"), content = "Hello Amsterdam"; container.className = "js-enabled"; content += "Tell me how you doin'!"; content += "I went on a nice boat ride last night!"; content += "...where Carrot Top made a pass at me..."; container.innerHTML = content;
  • 86. // Variable declaration function richAndStupid () { var rich = "And cause I was a gazillionaire, I cut that grass for free.", stupid = "Stupid is as stupid does."; }
  • 87. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0; i<allParagraphs.length; i++) { var link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; allParagraphs[i].className = "Forrested"; allParagraphs[i].appendChild(link); } }
  • 88. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0; i<allParagraphs.length; i++) { var link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; allParagraphs[i].className = "Forrested"; allParagraphs[i].appendChild(link); } }
  • 89. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0; i<allParagraphs.length; i++) { var link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; allParagraphs[i].className = "Forrested"; allParagraphs[i].appendChild(link); } }
  • 90. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0; i<allParagraphs.length; i++) { var link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; allParagraphs[i].className = "Forrested"; allParagraphs[i].appendChild(link); } }
  • 91. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) { link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; paragraph = allParagraphs[i]; paragraph.className = "Forrested"; paragraph.appendChild(link); } }
  • 92. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) { link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; paragraph = allParagraphs[i]; paragraph.className = "Forrested"; paragraph.appendChild(link); } }
  • 93. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) { link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; paragraph = allParagraphs[i]; paragraph.className = "Forrested"; paragraph.appendChild(link); } }
  • 94. // Looping, variables and array lookups function forrestForm () { var allParagraphs = document.getElementsByTagName("p"); for (var i=0, l=allParagraphs.length, link, paragraph; i<l; i++) { link = document.createElement("a"); link.href = "http://en.wikipedia.org/wiki/Forrest_Gump"; link.title = "Read about Forrest Gump at Wikipedia"; link.innerHTML = "Forrest Gump"; paragraph = allParagraphs[i]; paragraph.className = "Forrested"; paragraph.appendChild(link); } }
  • 95. // Semicolon insertion return { javascript : "Fantastic!" };
  • 96. // Semicolon insertion return; // Semicolon insertion { // Considered an empty block javascript : "Fantastic!" }; // Semicolon insertion, dummy line
  • 98.
  • 99. Robert Nyman http://robertnyman.com/speaking/ Twitter: @robertnyman Pictures: Ninja Turtle: http://www.originalprop.com/blog/2008/03/20/teenage-mutant-ninja-turtles-costume-restoration/ Dog (Cat): http://www.cartoonstock.com/directory/f/false_identity.asp Bruce Willis: http://www.starsjournal.com/3192/bruce-willis-is-being-sued-for-4-million-dollars.html Hillary Clinton & Soldier: http://confederateyankee.mu.nu/archives/154032.php Swedish flag: http://www.olssonfoto.se/JAlbum/SGP%202008%20Ullevi/slides/Svenska%20flaggan.html Play with yourself: http://www.justwhatshesaid.com/?p=965 Euro Coin: http://accidentaldong.blogspot.com/2009/10/euro-uh-oh.html Overloading: http://theshadowhive.blogspot.com/2010/04/mutating-chaos-gene.html Brad Pitt: http://open.salon.com/blog/just-walt/2009/10/29/real_men_he-men_pictures_whos_the_manliest_of_men Kristen Bell: http://veronica-mars-episodes.download-tvshows.com/kristen-bell-loves-megan-fox/ Most popular language: http://odetocode.com/Blogs/scott/archive/2009/03/18/signs-that-your-javascript-skills- Extensible table: http://www.amishshowroom.com/index.php?main_page=index&cPath=40_64 need-updating.aspx Tiger Woods: http://blogs.bigadda.com/pal4868546/2010/01/ Sunrise: http://www.manywallpapers.com/space-wallpapers/earth/sunrise-from-space.html Pollution: http://blog.lib.umn.edu/cramb005/architecture/ Astronaut: http://martianchronicles.wordpress.com/2009/01/23/carnival-of-space-87/ Closure: http://today.msnbc.msn.com/id/4760120 Netscape 2: http://blog.explorelearning.com/2005/12/index.html Steve Ballmer: http://www.businessinsider.com/microsoft-completely-rebooted-its-mobile-strategy-yesterday-heres- Internet Explorer 3: http://www.guidebookgallery.org/screenshots/browser what-you-missed-2010-2 Gandalf: http://web.mit.edu/kayla/Public/Backgrounds/LOTR%20Gandalf%204.JPG Inheritance: http://tithebarn.wordpress.com/2010/04/26/the-meek-shall-inherit-if-thats-alright-with-the-rest-of-you/ Now: http://www.geekologie.com/2007/07/15-week/ Crockford: http://gemsres.com/story/nov07/468365/Crockford_New_4681.jpg Axe: http://bestgamewallpapers.com/a3-the-age-of-sovereign/axe Name: http://blog.usa.gov/roller/govgab/tags/names Time: http://www.mindhacks.com/blog/seeing/index.html Space: http://gucken.deviantart.com/art/Sunrise-in-Space-56420137 Money: http://www.mediabistro.com/unbeige/ideas/ Fail better: http://ozguralaz.posterous.com/ever-tried-ever-failed-no-matt Happy Ape: http://thesituationist.wordpress.com/2007/06/14/ High speed train: http://www.freefoto.com/preview/23-22-1?ffid=23-22-1 Mila & Macaulay: http://uk.eonline.com/uberblog/b61889_mila_macaulay_home_alone.html Sunspider results: http://ie.microsoft.com/testdrive/benchmarks/sunspider/default.html Hearts: http://www.funonthenet.in/content/view/395/31/ Forrest Gump: http://wallpaper-s.org/36__Forrest_Gump,_1994,_Tom_Hanks,_Robin_Wright_Penn.htm Data: http://walrus.wr.usgs.gov/infobank/programs/html/definition/datadictionary.html