2👍
✅
You can use for
loop to achieve this. Concatenate the key and the message.
var json = { "email": [ "can't be blank" ], "password": [ "can't be blank" ] }
for ( var key in json ) {
console.log( key + " " + json[key] );
}
Source:stackexchange.com