Module 4 OOP - First Touch
Module 4 OOP - First Touch
OOP in JavaScript
D. Petin
06/2014
Agenda
▪ Custom objects
▪ Constructors
▪ Context and "this"
▪ Operator "new"
Custom Object
Object creation
You know that we can create a simple object in
JavaScript. We use JSON for this.
In console:
barzyk.run();
Barsyk run!
[1]
New: scenario of work
[5]
New: example
[3]
_temporary_ref.Cat();
this.name = "Murzyk";
this.run = function () { . . . }; [3]