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"];
In questa pagina del sito puoi guardare il video online JavaScript Datatypes: Object and Array Datatypes della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Binary Cave 16 aprile 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 122 volte e gli è piaciuto 9 spettatori. Buona visione!