jquery array key value each
each function and access info outside of the loop using square bracketsheight Object feet: 6, inches: 1. In a language like php this would be considered a multidimensional array with key value pairs, or an array within an array. Is there any standard way to do a for each over them with a function that returns the key, value and index?Object.keys() returns all own keys as Array and .forEach() loops over an array like shown above. console.log(array[key].Value) But, given what youve said you want to do, Im not seeing any need for a for-in loop: I want to push Value of object whose Key is Subject into a variable.I suggest using the jQuery.each() method for this. I have an array with some keys, and values in them.