<span id="Label3"></p>9. Short-circuit operation<p><p>&&, | | : When the sides are not boolean data or a judgment statement, it becomes a short-circuit operation.</p></p><p><p>&&:</p></p><p><p>&& look for a false first to see the value of the first expression, if the first expression is not a Boolean type, this value will be implicitly converted to a Boolean value, if the converted value is true, then directly return the second value, whether the second value is true or false, If the first data is false, it is returned directly to the first number, regardless of whether the second number is true or False.</p></p><p><p>|| :</p></p><p><p>|| For real, if the two value is not a boolean, the current object is converted to the corresponding Boolean value, and if the first value is converted to true, then it is returned directly, and if the first value is false after the conversion, a second value is Returned.</p></p><p><p>! :</p></p><p><p>Except false, "", 0 and nan, null, undefined with Plus! The result of the post operation is False.</p></p>10. Looping The nesting<p><p>A loop nesting is a loop within which another loop is Contained.</p></p><p><p>For loop nesting, the outer loop statement loops once, and the loop statement loops around N times.</p></p>ONE. Break statement<p><p>11.1 used in switch-case to jump out of the current Switch-case statement Program.</p></p><p><p>11.2 is used in the loop statement to end the loop of the loop statement where the break is.</p></p><p><p>Such as: can end the dead loop.</p></p>Continue statements<p><p>In general is also used in the word loop, when encountered continue statement, immediately stop this cycle, and from the next value to judge and Cycle.</p></p>The Math object<p><p>JS provides some methods for Math.</p></p><p><p>Such as:</p></p><p><p>Math.ceil () rounding up</p></p><p><p>Math.floor () Down rounding</p></p><p><p>Math.Round () Rounding</p></p><p><p>Math.random () Gets a (pseudo) random number greater than or equal to 0, less than 1</p></p><p><p>Math.pow (x, Y) to get a value of X's y power</p></p><p><p>Math.max (x, Y) Get maximum value</p></p><p><p>Math.min (x, Y) to get the minimum value</p></p><p><p>There are many objects of mathematics that can be tried on their own.</p></p>14. Arrays<p><p>An array is an ordered list of data that is stored as a set of Data. The data in the array can be of any type, and the elements in the array can be added dynamically at any Time.</p></p><p><p>14.1 Creating an array using constructors</p></p><p><p>var arr = new Array ();</p></p><p><p>14.2 Creating an array using the Literal method</p></p><p><p>var arr = [100,98,96,99,93,95,97,69,89,58,87];</p></p><p><p></p></p><p><p>JS Basic Learning 03</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service