I am trying to execute this piece of JavaScript code, but unfortunately it outputs "Timeout exceeded, make sure your code is executed no more than 1500ms." What is the problem with this code?
console.log('hlo')
let obj = {
bird: "yguhdjn",
color: 'blue',
eat:'insect'
}
function GetObjectKeys(obj, keys)
{
for (let key in obj)
{ if (typeof obj[key] == "object")
{
GetObjectKeys(obj[key], keys);
}
else {
keys.push(key);
}
return keys;
console.log(obj[key])
}
}