Skip to content

Tag: for-in-loop

Implement condition in for..in loop

I am looking at for..in tutorial from MDN documentation https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for…in The example iterates over the object’s properties and prints all. I am trying to print only if value of object’s property is 3. Can someone please help me understand where I am going wrong. And also if possible explain. Answer for…in loops can’t have conditions.ยน You have to implement the