DEV Community

Cover image for Javascript Object #1
Asir-Sam
Asir-Sam

Posted on

Javascript Object #1

To explain in brief,Javascript is programming language almost used in all web pages.The master language behind everything you see in the Web World.Let's See About His History in another Post.
Now Let's Look into Objects in Javascript,Among the 8 datatypes in them.The man we are going to see is a NON-PRIMITIVE man,as he is Different from others,he got the most powerfull one as he can store anyone of his 7 PRIMITIVE friends.Enough Story,let See what he capable of and How can we Create that Man.

CREATING OBJECT

The Most Common way of Creating him is

let object = {};
Enter fullscreen mode Exit fullscreen mode

Looking Simple Right,Yes he Looks like simple but he's not that easy
The ways we created the object man Above is called object literal Notation,the basic way.

Now let's Jump into and explore what his Strength and what he can hold

let objectName = {
firstName: 'SAM',
lastName: 'r',
}

Enter fullscreen mode Exit fullscreen mode

Just look Above he's holding something called firstName and lastName inside him.Confusing right? let make it easy,the firstName and lastName is called as key in javascript and value 'sam' and 'r' is called as value.In Javascript Objects are Stored as Key and Value Pairs and a single key value is called as a Property.

Here the key can we be String but the value can be anything,as i have told you they can store anyone of his PRIMITIVE FRIENDS and that's why they are stronger one the amongest.They can Store Array, Object, Function, String, Integer and his Other Friends.

That's Enough about Him for Now.But He is Big and Strong,Let's See how you can use access,update and delete him using some methods

Thank You!

Top comments (0)