JavaScript Datatypes: Object and Array Datatypes

Published: 16 April 2020
on channel: Binary Cave
122
9

JavaScript being an object-based language and in JavaScript almost everything is an object or acts like an object. So lets understand objects in JavaScript from datatypes perspective.
A JavaScript object is just a collection of key value pairs where keys are the properties of objectives and values are their values.
We create objects with the help of curly brackets {} with an optional list of properties. A property is a "key: value" pair, where the key (or property name) is always a string, and value (or property value) can be any data type, like numbers, booleans, strings or complex data type like arrays, functions, and other objects.
var student= {
name: "Majid",
parentage: "Ghulam Rasool",
age: 21,
gender: "Male",
};
Another important datatype in JavaScript is Array. An array is a kind of datatype used for storing multiple values under a single variable. Each element in an array has a numeric position, known as its index, and it may contain data of any data type-numbers, strings, booleans, functions, objects, and even other arrays. Arrays are zero indexed meaning index starts from 0, so that the first array element is arr[0] not arr[1].
var courses= ["BCA", "BSC", "BA", "Commerce"];


On this page of the site you can watch the video online JavaScript Datatypes: Object and Array Datatypes with a duration of hours minute second in good quality, which was uploaded by the user Binary Cave 16 April 2020, share the link with friends and acquaintances, this video has already been watched 122 times on youtube and it was liked by 9 viewers. Enjoy your viewing!