23
Javascript explained for Java developers

Javascript explained

Embed Size (px)

Citation preview

Page 1: Javascript explained

Javascript explainedfor Java developers

Page 2: Javascript explained

Javascript is the “de facto” standard of the Web today

still… many of the developers are coming from the Java world

Page 3: Javascript explained

Javascript ecosystem evolves more dynamically

… than what Java devs are used to

Page 4: Javascript explained

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

Page 5: Javascript explained
Page 6: Javascript explained

Types

String, no char

Number, no int

Object

Array, Function (both are objects)

Page 7: Javascript explained

Type Typeof

Object ‘object’

Function ‘function’

Array ‘object’

Number ‘number’

String ‘string’

Boolean ‘boolean’

null ‘object’

Undefined ‘undefined’

Page 8: Javascript explained

Style

return{

ok: false};

return {ok: true

};

Page 9: Javascript explained

Operators

0 == ‘’ // true

0 == ‘0’ //true

‘’ == ‘0’ //false

Page 10: Javascript explained

Weird types, weird values

NaN === NaN //falseNaN !== NaN // true

typeof NaN // Numbertypeof null // Object

Page 11: Javascript explained

Falsy / Thruthy

falsenull

Undefined‘’0

NaN

Page 12: Javascript explained

var me = {name: ‘Jana’,age: 32,children: ‘Maybe some day’,pets: [{

name: ‘Baron’, species: ‘dog’

}]};

Page 13: Javascript explained

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

Page 14: Javascript explained
Page 15: Javascript explained

Function scope demo

Page 16: Javascript explained

Javascript, in Crockford’s own words, it’s conflicted in its nature

functional language with dynamic typing and prototypal inheritance

Inheritance demo

Page 17: Javascript explained

AngularJs MVW framework

HTML augmentation, both ways binding, templating

Single page applications, rich and fluid UI’s

AnuglarJs demo

Page 18: Javascript explained

Javascript ecosystem

Page 19: Javascript explained

Javascript frameworks

Page 20: Javascript explained

Javascript tools

Page 21: Javascript explained

proprietary frameworks vs. open source

exhaustive manuals vs. github docs and cheat sheets

expensive trainings vs. quick and available MOOC

Page 22: Javascript explained
Page 23: Javascript explained

Thank you!