I don't have a device to test it. Does this https://jsfiddle.net/bzyyvafg/ work?
@posva Yeah it works I just wanted to post the same example. For in breaks the app because OP doesn't use hasOwnProperty check and is looping over inherited properties which you definitely want to avoid. I recommend to start using Eslint and follow good JS practices - https://github.com/airbnb/javascript#iterators-and-generators
Then I'm closing this 🙂
it works. thanks
Most helpful comment
@posva Yeah it works I just wanted to post the same example. For in breaks the app because OP doesn't use
hasOwnPropertycheck and is looping over inherited properties which you definitely want to avoid. I recommend to start using Eslint and follow good JS practices - https://github.com/airbnb/javascript#iterators-and-generators