javascript init associative array
var arr = { "one": 1, "two": 2, "three": 3 };
javascript init associative array
var arr = { "one": 1, "two": 2, "three": 3 };
javascript associative array
/*
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
*/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us