javascript associative array
var arr = { "one": 1, "two": 2, "three": 3 };/*
Associative array in javascript
There are multiple programming supports array and arrays is having different types i.e
1. Index Array
2. Associative Array
3. Multidimentional Array
But as question asked javascript does not support associative array with named indexes.
Javascript only use numbered indexes in arrays.
*/
Example
var studentDetail = [];
studentDetail[0] = "Code";
studentDetail[1] = "Grepper";
studentDetail[2] = 24;
studentDetail[3] = 'Mumbai';
var x = studentDetail.length; // studentDetail.length will return 4
var y = studentDetail[1]; // studentDetail[0] will return "Grepper"
/*
I hope it will help you.
Namaste
Stay Safe Stay Home
*/
Also in JavaScript:
- looping through an object of objects with arrays
- ISS proxy express
- javascript associative array
- get largest number in array javascript
- find element in array underscore js
- javascript fastest loop
- openseamap nodejs github
- how to use platform.select
- bootstrap validator password and confirm password
- jquery add items to select input
- javascript confirm yes no
- node promisify without err
- redirect through javascript
- money pipe angular
- get selected option text jquery
- view background image in react native
- parsefloat jquery
- google script get date without time
- change span value javascript
- javascript convert number to binary
- attr hidden to show jquery
- Javascript compare two dates
- regex optional whitespace characters
- how to get name array value in jquery