2. ROAD MAP
2
1. JS - Present, Past & Future
2. Javascript Vs jQuery
3. JS Engine
4. Value & Identity
5. Class Vs Prototype
6. Object
7. Delegation
8. Closures
9. DOM & Left things (Next Time)
4. 4
JS – PRESENT, PAST & FUTURE
jQuery, Mootools, YUI etc(Client Side Framework)
Client Side Server Side
Angular JS(By Google)
Backbone JS
etc
Node JS
Narwhal
etc
5. WHAT WE CAN NOT DO IN JS
- File I/O
- Using Ajax, JavaScript can send a request to the server. This
request can read a file in XML or plain text format but it cannot write
to a file unless the file called on the server actually runs as a script
to do the file write for you.
- Networking
- DB APIs
- unless you use Ajax and have a server side script perform the
database accesses for you.
- So, Node or other JSs has come.
5
7. WHAT IS JAVASCRIPT ENGINE ?
A JavaScript engine is process virtual machine which interprets
and executes JavaScript (also known as ECMAScript).
Source – WiKi
Web Browsers Engine Used
FF SpiderMonkey
Chrome V8
Safari JavascriptCore
IE Chakra
7
9. JAVASCRIPT BY OOPS, BUT NOT
"CLASS"-ICAL LANGUAGES.
- Object-Oriented
- Class – Object Relation
- But there are no classes in JavaScript. Functions can be
used to somewhat simulate classes.
- And when it comes to inheritance, objects inherit from
objects, not classes from classes as in the "class"-ical
languages.
- So, Java Script is NOT a "class"-ical languages.
9
10. CLASS VS PROTOTYPE
- Yes, there are no classes in JavaScript.
- But Functions can be used to somewhat simulate classes.
- A drawback of CLASS is that the method getInfo() is
recreated every time you create a new object.
- A more inexpensive way is to add getInfo() to the
prototype of the constructor function.
- Class - Based :
- Code reuse through Inheritance
- Class - Object communication
- Prototype - Based :
- Code reuse through delegation
- Class - Object communication
10