About the "+ =" Connector for JavaScript

Source: Internet
Author: User

Today, when I read "JavaScript Dom programming Art", I saw that I was unfamiliar with the + = Connector ( small white one, please do not ridicule)

"+ =" connector, which can be considered as "addition and assignment" (or "stitching and assigning")

For example:

The output is:

In fact, one of the processes of experience is:

var day = new Date ();

var message = "The time I wrote the blog is";

message = Message+day;

Console.log (message);

This process is a concatenation after the assignment of the process, the message and day are stitched into a new string, re-assigned to the message;

We're looking at a second example:

This is a process of adding and assigning values first.

var a = 10;

var B = 20;

A = A+b;

Console.log (a);

Summary: + = connectors, let's take him as a process to complete the "addition and assignment" or "stitching and assigning"!

About the "+ =" Connector for JavaScript

Related Article

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.