Given two arrays arr1 and arr2 of size n. The task is to iterate both arrays in the foreach loop. var nArray= new Array(); The index type for an associative array can be one of a set of supported data types. . aArray['india'] = ".in"; Hashes (associative arrays) are an extremely useful data structure in the Perl programming language. var aArray = new Array(); Many JavaScript programmers get very confused about the way that the Array object works. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy, JavaScript Training Program (39 Courses, 23 Projects, 4 Quizzes), 39 Online Courses | 23 Hands-on Projects | 225+ Hours | Verifiable Certificate of Completion | Lifetime Access | 4 Quizzes with Solutions, Angular JS Training Program (9 Courses, 7 Projects), Software Development Course - All in One Bundle. The Associative Array. These associative arrays are also known as maps or dictionaries. For deleting properties of associative array, we have ‘delete’ statement. The example of creating an associative array in PHP is as given below: = {key1:’value1’, key2:’value2’, key3:’valu3’…..}, employee = {101:’Karthick’, 102:’Saideep’, 103:’Anusha’}. Associative Arrays, indexed by an integer. In this case, the PHP associative array plays its role. } //Normal array returned by array get. And each element in the sub-array can be an array, and so on. The index-by table is commonly called the associative array. myObject.fedex= ".fed"; Operations associated with this data type allow: the addition of a pair to the collection the removal of a pair from the collection For example if you want to store 100 numbers then instead of defining 100 variables its easy to define an array of 100 length. An array is a special variable, which can hold more than one value at a time. An array is a special variable, which can hold more than one value at a time. Traversing PHP Associative Array.