I am pretty new to JavaScript and I am working on this practice question that asks to create a function that returns the keys out of an object (without using the object.keys method). I have tried a few different iterations of the following code, and would appreciate a nudge in the right direction toward solving this problem!
function keys(obj) {
let firstLoop = [];
let newObj = Object.entries(obj);
for (let i = 0; i <= newObj.length; i ++){
firstLoop.push(newObj[i]);
return firstLoop;
}
for (let j = 0; j < firstLoop.length; i ++){
return firstLoop[j];
}
}