JavaScript - OOP - Prototypal

javascript-oop

How can we create a bare-bone object?

var barebone = new Object();
var barebone = {};

Can we dynamically add any properties to an object?

Yes.

var barebone = new Object();
barebone.createdAt = new Date();
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License