Javascript examples for Object:Object Keys
Retrieving key of a JavaScript object using its index in JQUERY
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.0.2.js"></script> <script type="text/javascript"> $(window).load(function(){/* www .j a v a 2 s .c om*/ var obj = { "set1": [1, 2, 3], "set2": [4, 5, 6, 7, 8], "set3": [9, 10, 11, 12] }; var arr = [] for (var key in obj) { arr.push({key:obj[key]}); } console.log(arr[1]) }); </script> </head> <body> </body> </html>