DEV Community

Tejkumar Kempaiah
Tejkumar Kempaiah

Posted on

πŸ”₯ Objects in JavaScript

β˜‘οΈ What are Objects?

  1. Objects are collection of property and property values
  2. Every object has state and behavior
  3. A real time object is mimicked in the programming world
  4. A object can contain below things in it.

a. variable(integer, decimal, Boolean, character, string)
b. array
c. function
d. another object

β˜‘οΈ How to create objects in JavaScript?

image

Output:

image

β˜‘οΈ How to make an object read only?

image

Output:

image

β˜‘οΈ How to make an object extensible(un expandable) but modifiable

image

Output:

image

β˜‘οΈ How to expand an object property ?

image

Output:

image

β˜‘οΈ How to add an Boolean object property to an Object?

image

Output:

image

β˜‘οΈ Object DE structuring

image

Output:

image

Top comments (0)