1 / 14

Advanced JS The World's Most Misunderstood Programming Language ) Douglas Crockford (

Advanced JS The World's Most Misunderstood Programming Language ) Douglas Crockford (. Shimon Dahan sdahan@jbh.co.il. Agenda. Basic JavaScript Overview Closures JavaScript Objects Model Prototype Inheritance More OOP Concepts. Basic JavaScript. Variables

Download Presentation

Advanced JS The World's Most Misunderstood Programming Language ) Douglas Crockford (

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced JS The World's Most Misunderstood Programming Language) Douglas Crockford( Shimon Dahan sdahan@jbh.co.il

  2. Agenda Basic JavaScript Overview Closures JavaScript Objects Model Prototype Inheritance More OOP Concepts

  3. Basic JavaScript Variables Variable names are case-sensitive. Variables can be implicitly declared JavaScript is a loosely typed language Variables types Variables scope === VS ==

  4. Functions functions are objects special feature: invokable Can pass more argument (or less) that declared arguments property The arguments of a function are maintained in an array-like object Functions always return something this keyword – call & apply

  5. Functions Functions can be defined inside of other functions.

  6. Reference & Value Primitive values Undefined, Null, Boolean, Number, and String Reference values  Array or a user-defined object Parameters are always passed by value. Note that if you pass an object, the address of the object is passed by value, but changes we make affects the original object.

  7. Closure An inner function has access to the variables and parameters of functions that it is contained within. The scope that an inner function enjoys continues even after the parent functions have returned

  8. JavaScript Objects Model What’s an object? a hash of key => value pairs if a key (property) happens to be a function, we can call it a method Object literal notation { Wrapped in curly braces } ,-delimited properties key:value pairs The scope that an inner function enjoys continues even after the parent functions have returned

  9. JavaScript Objects Model Constructors When invoked with new, functions return an object known as this You have a chance of modifying this before it's returned

  10. Encapsulation A Public Method is a function that uses thisto access its object This binding of thisto an object happens at invocation time Use Closure for private fields

  11. Prototype A property of the Function objects A prototype is an object from which other objects inherit properties The prototype chain

  12. Inheritance via the prototype var Dad = function () { this.family = “Levi"; }; var Kid = function () { }; Kid.prototype = new Dad(); varmoti = new Kid();

  13. תודה :)

More Related