July 2017
Intermediate to advanced
300 pages
5h 43m
English
JavaScript implies a prototype-based, object-oriented programming style. It differs from class-based OOP that is used in other popular programming languages, such as C++, C#, Objective-C, Java, and PHP. This used to confuse newcomer developers. ES2015 offers a syntactic sugar over the prototype, which looks pretty much like canonical classes:
class Machine { constructor( name ){ this.name = name; } } class Robot extends Machine { constructor( name ){ super( name ); } move( direction = "left" ){ console.log( this.name + " moving ", Robot.normalizeDirection( direction ) ); } static normalizeDirection( direction ) { return direction.toLowerCase(); } } const robot = new Robot( "R2D2" ); robot.move(); robot.move( "RIGHT" ...Read now
Unlock full access