Javascript Objects

Javascript Objects

An object is a composite value it aggregates multiple values (primitive values or other objects) and allows you to store and retrieve those values by name.


An object is an unordered collection of properties, each of which has a name and a value.

Create Objects

You can create objects with the new keyword.


Syntax


var info = new object();


Object Properties

To create or set a property, use a dot or square brackets


Syntax


info.studentName = " Rahul ";
info["course"] = " Rahul ";


Object Methods

To create or set a property, use a dot or square brackets


Syntax


document.write("This is example of Methods");
PreviousNext

Join Us And Get Our Latest Tutorials Updates Via Email