JS Objects

JavaScript Objects

JavaScript Objects

  • An object is a collection of properties and methods withheld under one name.

Properties

Properties or attributes of an object describes the special features and identity.

<script>
var a="Hello people!";
 document.write(a.length);
</script>

Result:

13

Methods

Methods or functions of an object are actions that can be performed on an object.

<script>
var a="Hello people!";
 document.write(a.bold());
</script>

Result: