Javascript examples for jQuery:Array
Extract the property values of a JavaScript object into an array
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(window).load(function(){/* w w w . ja va 2 s . co m*/ var dataObject = { object1: {id: 1, name: "A"}, object2: {id: 2, name: "B"}, object3: {id: 3, name: "C"} }; var arr = $.map(dataObject,function(v){ return v; }); console.log(arr); }); </script> </head> <body> </body> </html>