eg if variable jsonstring contains
{"prod_name":"GM","quantity":100,"price":54.5,"type":"Limit"} for a code like
var obj= JSON.parse(jsonstring); Without knowing the string content is there a way to extract the property/ value names?
You can loop through the object properties.
for ( var prop in obj ) { if ( obj.hasOwnProperty(prop) ) { console.log( prop + ': ' + obj[prop] ); } } hasOwnProperty isn't really necessary.Object prototype it is necessary.
for ... in,Object.keys()...