Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Javascript

6ft below sea level
by

Shilp Gupta

on 13 August 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Javascript

Javascript
6ft below sea level
big deal!
basics
scratching the surface
functional heritage
must knows!
patterns!?
frameworks
so what have you used javascript for?
what do you expect from a serious programming language?
do you think it is a serious progrmming language?
World's most misunderstood language!
name.. Java + Script
more lisp than C
typecasted for the web
Mocha
Live Script
JScript
ECMA Script
bad implementations!
not a toy language!
nice,
small,
dynamic,
general purpose language
Lets explore!
multi paradigm,
powerful,
fire up your fire-bug
types
Operators
number
Arithmatic
string
+ - * / % ++ --
array
object
null
undefined
NaN
function
truthy / falsy
Assignment
= += -= *= /= %=
Logical
&& || !
Comparison
== === != !== > < >= <=
Concatenate
Concatenate on Strings
Adding Strings and numbers
functions
exception handling
object
conditionals
loops
if / else
switch / case
for
while
for-in
{ }
new Klass()
var fun = function fun() { }
try { throw "Error"; } catch(e) { } finally { }
scope
invocation
global
function
no block scope
method
function
constructor
apply
prototype
prototypal inheritence
modifying the .prototype
if ( youAre in {
function.prototype
object.prototype
doubt :'(',
distrust :'(',
disbelief :'(',
discomfort :'(',
disorientation :'(',
difficulty :'('
} ) askQuestions();
objects inherit from objects
constructor functions
being prototypical!
.push
.shift
.slice
.splice
.unshift
.reverse
.sort
.pop
.length
.length
immutability
.chatAt
.indexOf
.toLowerCase
.toUpperCase
.match
.split
.substring
lookup / delegation through the prototype chain
why the prototype?
var a = function a() { }
function
closures
λ
λ
λ
function {
function { }
}
function
nested functions
first class functions
scope
context
creation
what happens when funtion can be treated as data?
can be saved inside data structures
elegant event-engines
can have properties / methods of their own
any function object can be invoked with ( )
anonymous functions
invoking a lambda inline simulates block scope
(lambda)
C like syntax
Java like name
Scheme like functions
Self like object model
higher order functions
functions as arguments
functions as return values
lexical vs dynamic scope
a function that returns a function
creates what we call, a closure
which can access non-local variables
wait, what!?
lets try an example.
how did that work?
advantages?
disadvantages.
chaining / fluency
mixin
callbacks
events
deferred / promise
connect
return this and reuse the return value
checkout chaining in string and array
arguments
call / apply
merge properties
binding
setInterval
setTimeout
lets pass some functions around
We promise you we will call you once the result is available
Dont trust us?? Take the proxy of the result
When this event occurs on this object, call me !!
eval
modules
instanceof / typeof
.hasOwnProperty
.toString
and more!!?
curry
pub-sub
OO patterns
singleton
decorator
observer
generic functions for specific use-cases.
custom events FTW!
dojo
underscore
jquery
node.js
strategy
function Klass() {
var instance = this;
..snip..
Klass = function() {
return instance;
}
}
someProps = { ... }
someMoreProps = { ... }

var item = new Klass();

decorate(item, 'Props')
decorate(item, 'MoreProps')
executor.addStrategy(
validator,
execute)

executor.execute(args)
informListeners(onItem)

addListener(onItem,
context,
callback)
why?
json
anti-patterns
good parts
use jslint
dont touch global..
no, not even for that!
declare all variables
at the top of their scope
dont you dare eval
dont concatenate many
strings using '+'
dont '===' undefined
use blocks for single
statements too!
name your Constructors
in Capital
Full transcript