Your SlideShare is downloading. ×

JavaScript: The Language

2,823

Published on

An overview of the fundamental features of JavaScript, highlighting the unexpected and obscure features that make it behave different than other languages in the C family.

An overview of the fundamental features of JavaScript, highlighting the unexpected and obscure features that make it behave different than other languages in the C family.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,823
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
30
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • for in enumerates all properties in prototype chain   + is for addition and concatenation (make sure both are numbers if you want addition) + and ! are also for coercion
  • Image Carousel example
  • vv            
  • Transcript

    • 1. Fundamental JavaScript: The Language Presented by Brian Dukes
    • 2. Where are we going?
        • Feature Overview
        • Syntax
        • Objects
        • Functions
        • Inheritance
        • Miscellaneous
    • 3. Feature Overview
        • 1st Class Functions
        • Loose Typing
        • Dynamic Objects
        • Prototypal Inheritance
        • Global Variables
    • 4. Where are we?
        • Feature Overview
        • Syntax
        • Objects
        • Functions
        • Inheritance
        • Miscellaneous
    • 5. Syntax: Primitive Types
        • Number
          • 64-bit floating, " double "
        • String
          • Surrounded by single or double quotes
        • Boolean
          • true or false
        • Objects
          • Key/value pairs
        • Arrays
          • Indexed collection
        • Functions
          • Callable code
    • 6. Syntax: Truthy & Falsy Values
        • Falsy values:
          • false
          • null
          • undefined
          • ''
          • 0
          • NaN
        • Truthy values:
          • Everything else
          • true , 'false' , {}
    • 7. Syntax: Statements & Operators
        • var
        • if
        • switch
        • while
        • for
        • for in
        • do while
        • try
        • throw
        • return
        • break
        • with
        • ternary ( ? : )
        • typeof
        • ||
        • &&
        • == & ===
        • != & !==
        • +
        • !
    • 8. Where are we?
        • Feature Overview
        • Syntax
        • Objects
        • Functions
        • Inheritance
        • Miscellaneous
    • 9. Objects: Literals
        • JSON (plus functions)
          • Name/value pairs
          • Name is any string
            • Quotes are optional for legal name
          • Value can be any JavaScript value:
            • Other objects
            • Functions
            • Arrays
    • 10. Objects: Setting & Getting
      • var flight = {
      •     airline: "Oceanic",
      •     number:  815
      • };
      • alert(flight.airline);
      • alert(flight.equipment); // undefined
      • flight.equipment.status // throw "TypeError"
      • flight.equipment = {
      •     model: 'Boeing 777'
      • };
      • flight['flight-status'] = 'overdue';
      • alert(flight["flight-status"]);
    • 11. Where are we?
        • Feature Overview
        • Syntax
        • Objects
        • Functions
        • Inheritance
        • Miscellaneous
    • 12. Functions: Definition
        • Functions are objects
          • Functions have a prototype
          • Functions can have properties
          • Functions can have methods
          • Functions can be passed as arguments to functions
          • Functions can be returned from functions
        • Functions can be invoked
    • 13. Functions: Closure
        • Functions have access to outer variables
        • this & arguments are different for each function  
      • var i;
      • for (i = 0; i < 10; i++) {
      •     setTimeout(function () {
      •         console.log(i*i);
      •     }, i);
      • }
      •  
    • 14. Functions: Scope
        • Does not have block scope
          • Unlike every other language with C style syntax
        • Function scope
      • function outer () {
      •     for (var i = 0; i < 10; i++) {
      •         var double = i+i;
      •         $link.click(function () { 
      •             alert(double) 
      •         });
      •     }
    • 15. Functions: Callbacks
        • Functions can be passed to other functions
      •  
      • makeAjaxCall(function (result) {
      •     alert(result);
      • }); 
    • 16. Functions: Module Pattern
        • Call an anonymous function after declaring it ( IIFE )
        • Keeps inner values from being accessible outside of the function
      •  
      • (function () {
      •      var x = 1;
      • }());
    • 17. Where are we?
        • Feature Overview
        • Syntax
        • Objects
        • Functions
        • Inheritance
        • Miscellaneous
    • 18. Inheritance: Pseudoclassical
        • new operator
        • Function names are capitalized, by convention
        • Lots of downfalls
    • 19. Inheritance: Prototype
        • All objects has a prototype property
        • When retrieving properties, any property not on the object is retrieved from its prototype
        • If the property isn't on the prototype, its prototype is checked, etc.
    • 20. Where are we?
        • Feature Overview
        • Syntax
        • Objects
        • Functions
        • Inheritance
        • Miscellaneous
    • 21. Miscellaneous: Arrays
        • Literal notation: [true, 1, &quot;string&quot;, {}]
        • length property
        • Not bounded
          • Use push method to add to the end
        • Is a weird object, not a &quot;real&quot; array
    • 22. Miscellaneous: Regular Expressions
        • Pattern Matching
        • Literal notation: /pattern/options
    • 23. Resources
        • JavaScript Weekly - http://javascriptweekly.com/
        • JSLint - http://www.jslint.com/
        • JSLint.VS2010 - http://bit.ly/JSLint-VS2010
        • jsFiddle - http://jsfiddle.net/
        • MDC -  https://developer.mozilla.org
        • This - http://www.slideshare.net/EngageSoftware/

    ×