Get JSON key name [duplicate]

So now the problem I am facing is that, what about if I want to alert
success. Is there a need way to get it ?

If your object is

var obj = {"success":"You are welcome"};

You can get the array of keys as

var keys = Object.keys(obj);

and then print it as

console.log( keys[ 0 ] ); //or console.log( keys.join(",") )

var obj = {"success":"You are welcome"};
var keys = Object.keys(obj);
console.log(keys[0]);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)