Dapatkan semua properti objek di JavaScript
Object.keys(data).forEach(function (key, index) {
var value = data[key];
console.log(key,index, value);
});
Purple Team
Object.keys(data).forEach(function (key, index) {
var value = data[key];
console.log(key,index, value);
});
const user = {
name: 'Alex',
age: 30
};
const props = Object.keys(user);
console.log(props); // [ 'name', 'age' ]