In Javascript: print a json object
var myObject = new Object;
myObject.type = "Fiat";
myObject.model = "500";
myObject.color = "White";
in below format
{ type: 'Fiat', model: '500', color: 'White' }
in console.log .
But actual result
{"type":"Fiat","model":"500","color":"White"}
Challenge is here :
function printObjectProperty(myObject) {
//Write your code here
console.log(JSON.stringify(myObject));
//OR
console.log("{ type: '"+myObject.type+"', model: '"+myObject.model+"', color: '"+myObject.color+"'}"); //OR THERE COULD BE A BETTER GENERIC SOLUTION
}