ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Object-oriented and
Functional JavaScript
               jason harwig
why so long?
1.
¡°JavaScript is the world¡¯s
most misunderstood language¡±


                   - douglas crockford
2.
no classes
public class Presentation {

    public static void main(String[] a) { }

}




                                              7
JavaScript Language Paradigms
3.
¡°No JavaScript¡±


    - pointy-haired boss
why now?
JavaScript Language Paradigms
classical inheritance through
            libraries
¡°I want it to be web 2.0¡±


              - pointy-haired boss
JavaScript Language Paradigms
what do I need to know?
1.
JSON
var presentation = {

       name: ¡®oojs¡¯,

};




                       19
var presentations = [

];




                        20
var presentation = {

       name: ¡®oojs¡¯

};




                       21
abstract   else         int         switch
as         enum         interface   synchronized
boolean    export       is          this
break      extends      long        throw
byte       false        namespace   throws
case       final        native      transient
catch      finally      new         true
char       float        null        try
class      for          package     typeof
continue   function     private     use
const      goto         protected   var
debugger   if           public      void
default    implements   return      volatile
delete     import       short       while
do         in           static      with
double     instanceof   super
                                              22
2.
¡°prototype is like a rosetta
                       stone¡±


                         - brian dillard
                  jquery vs. prototype
3.
functions
functions as variables
functions without names
functions as constructors
functions vs methods
namespacing
objects
scopes
encapsulation
inheritance
no dot equals?!?
JavaScript Language Paradigms
libraries
prototype.js
Presentation = Class.create({

     initialize: function() { }

})




                                  40
JQuery Classy Query
JavaScript 2.0
twitter: jharwig
jason.harwig@nearin?nity.com
    nearin?nity.com/blogs


  careers@nearin?nity.com


                               43

More Related Content

JavaScript Language Paradigms