Surprising behavior of for...in loop
In this article, we will see how to use for...in loops to avoid unpredictable bugs.
Take a look at the below code:
const user = { name: 'David', age: 30 };
for (key in user) {
console.log(user[key]);
}
Can you predict the output of the above code?
...
blog.yogeshchavan.dev2 min read