You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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
Activity
posva commentedon Sep 7, 2016
I don't have a device to test it. Does this https://jsfiddle.net/bzyyvafg/ work?
sqal commentedon Sep 7, 2016
@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-generatorsposva commentedon Sep 7, 2016
Then I'm closing this 🙂
draguo commentedon Sep 8, 2016
it works. thanks