CHAPTER - 13

Object In Javascript

Objects are also a kind of variable but the difference between a normal variable and an object is that an object can hold many values while a variable can hold only one value. The object value is always in the key-value pair.

Example:

var languages = {

‘Graphic’:’Photoshop’,

‘Coding’:’javascript’,

‘desktopApplication’:’Visual Basic’
};

Now if you want to display the value of any object element, you can do this.
console.log(languages.Graphic);

Result: Photoshop


Comments

Popular posts from this blog

CHAPTER - 14

CHAPTER - 18