JavaScript Language Basics 5

Source: Internet
Author: User

Talking about numerical computation and character manipulation

Let's start by analyzing the following code:

<span style= "FONT-SIZE:14PX;" >
The effect is as follows:


JavaScript supports a variety of basic mathematical operations, defining variable value1, adding, minus, multiplying, and removing

Support for self-increment (+ +) and auto-subtract (--) in JavaScript

The above code we focus on these two sentences

<span style= "FONT-SIZE:18PX;" >value4=value5++-1;</span>
<pre name= "Code" class= "JavaScript" ><span style= "font-size:18px;" > Results for 7</span>
<span style= "FONT-SIZE:18PX;" > This shows that Value5-1 is assigned to Value4, and then value5 self-increment, so the result is 7</span>
<span style= "FONT-SIZE:18PX;" >value4=--value5-1;</span>
<span style= "FONT-SIZE:18PX;" > Results for 6</span>
<span style= "FONT-SIZE:18PX;" > Operation process: First value5 is self-reduced, then minus 1, resulting in 6</span>

JavaScript also supports the addition of characters, connecting characters with the + sign, or adding characters to numeric values


Reprint Please specify source: http://blog.csdn.net/hai_qing_xu_kong/article/details/40804789 Emotional Control _


JavaScript Language Basics 5

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.