"JavaScript: The Good Parts" Summary

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    "JavaScript: The Good Parts" Summary - Presentation Transcript

    1. JavaScript: The Good Parts @jonathanjulian
    2. crockford.com
    3. First, the Bad Parts
    4. globals. optional ; truthy/falsy. scope.
    5. Then, the Good Parts!
    6. functions as objects. loose typing. dynamic objects. literals.
    7. The Bad Parts
    8. globals • x = 1; • var y = 1; • x is in the global namespace • YourAppName.x = 1;
    9. line termination • semi-colons are INSERTED by the parser • optional semi-colons are not a “language feature” • you are not warned
    10. truthy / falsy
    11. ==
    12. === All of these are false
    13. take advantage • if (x) • if (myobject.propery) • if (myobject.property == null) // no, No, NO! • test for exactly what you want to test for • ...or not • KNOW THE FALSY VALUES undefined, null, false, 0, ‘’, NaN
    14. no block scope • functions create scope • blocks do not
    15. The Good Parts!
    16. functions are objects • can be passed, returned • have scope • have closure
    17. loose typing • no compiler • no type heirarchies
    18. objects are dynamic • members can be added to any object, any time • helpful to attach attributes
    19. object literals • aka JSON • { count: 2, prefix: ‘pre_’ } • pass options to functions • JSON as communication • JSON as persistence • etc
    20. Know the bad parts are there...and avoid them
    21. Learn and love the good parts!
    22. tools • FireBug • JSLint • spidermonkey / rhino / v8
    23. takeaway • think about vars and scope • never use == • if (myobject) { • jslint.com
    24. JavaScript is a beautiful language
    25. jonathan.m.julian@gmail.com @jonathanjulian jonathanjulian.com

    + Jonathan JulianJonathan Julian, 4 months ago

    custom

    325 views, 0 favs, 1 embeds more stats

    A summary of Douglas Crockford's amazing book "Java more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 325
      • 292 on SlideShare
      • 33 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 1
    Most viewed embeds
    • 33 views on http://jonathanjulian.com

    more

    All embeds
    • 33 views on http://jonathanjulian.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags