Upload
jana-karceska
View
51
Download
0
Embed Size (px)
Citation preview
Javascript explainedfor Java developers
Javascript is the “de facto” standard of the Web today
still… many of the developers are coming from the Java world
Javascript ecosystem evolves more dynamically
… than what Java devs are used to
Javascript script syntax has nothing to do with Java except that is looks familiar
Javascript execution environment is completely different from Java envs
Javascript community was built mainly by millennialsJava is getting old
Types
String, no char
Number, no int
Object
Array, Function (both are objects)
Type Typeof
Object ‘object’
Function ‘function’
Array ‘object’
Number ‘number’
String ‘string’
Boolean ‘boolean’
null ‘object’
Undefined ‘undefined’
Style
return{
ok: false};
return {ok: true
};
Operators
0 == ‘’ // true
0 == ‘0’ //true
‘’ == ‘0’ //false
Weird types, weird values
NaN === NaN //falseNaN !== NaN // true
typeof NaN // Numbertypeof null // Object
Falsy / Thruthy
falsenull
Undefined‘’0
NaN
var me = {name: ‘Jana’,age: 32,children: ‘Maybe some day’,pets: [{
name: ‘Baron’, species: ‘dog’
}]};
Java has classes, methods, constructors
Javascript has functions
Function is an object(actually with each function declaration we create couple of objects )
Every Function can have methods
Functions better NOT be declared in if or for statements
Function scope demo
Javascript, in Crockford’s own words, it’s conflicted in its nature
functional language with dynamic typing and prototypal inheritance
Inheritance demo
AngularJs MVW framework
HTML augmentation, both ways binding, templating
Single page applications, rich and fluid UI’s
AnuglarJs demo
Javascript ecosystem
Javascript frameworks
Javascript tools
proprietary frameworks vs. open source
exhaustive manuals vs. github docs and cheat sheets
expensive trainings vs. quick and available MOOC
Thank you!