Statement part - 2

Continue to engage statement! !

for-in statement

for-in statement applies to arrays and objects traverse. For an array of iterations out of the array elements, the object of iterations out of the property of the object. for example:

arrItem here represents the single array element inside each array

objItem here is that the object corresponding to the inside of the key value, the corresponding value if you want to adopt objItem worth, then you can go to find out the value of the elements of value inside the obj

switch statement

a switch statement is judged more powerful logic statements, similar to the multilayer if else, its syntax is: switch (expression) {case n: code blocks break; case n: code blocks break; default: default block }

break statement

break statement out of the loop

continue Statement

continue statement to skip (do nothing during skip) cycle

return statement

return usage I think there are two, the first is to give the name suggests a return value, the second use is the logical end of the current scope of the body, that is, after all a scope, return statement things are written in white

Reproduced in: https: //juejin.im/post/5d091c5351882548ac439f02

Guess you like

Origin blog.csdn.net/weixin_33724659/article/details/93181526