For ... in and for of and forEach
for in will iterate the attribute in the container etc []. however the length of container will not changed. but the result will changed.
Therefore, you can use "for of" to fix this issue.
The best practise is that apply foreach
2. "use strict"
if the variable which is not declared with "var", JS will consider it as global vairable. absolutely, it will affect your debug result.
Normally, please add 'use strict'; in the first line of your js source code.
3. Be careful of "return"
Because the statement of "return" had been added ";" at the end. it will return undefine. the right way is as below: