Generation

generate functionSun, 13 Nov 2022

iterate an objects properties

function getKeys(obj){ var keys = []; for(var key in obj){ keys.push(key); } return keys; } var c = { name: 'Clementine', age: 32, height: 5.5 }; getKeys(c);

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant