What is the add by value operator?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is the add by value operator?
Rating:
The add by value operator is an assignment operator that is used for adding numbers and for concatenating strings. Its sign is +=. When this operator is used, the operands on the right side are added, and the result is assigned to the left operand.
For example:
The above statement means that
If the value of x is 3, and the value of y is 12, the result will be 15, and it will be assigned to x.
This operator also performs string concatenation as follows:
tag+="<head><title>My web page </title></head>"
tag+="<body><p>This is my first web page </body>"
tag+="</html>"
Rating:
Was this information helpful?
Other articles
- How to create a cookie?
- How is a domain related to the setting of a cookie?
- What is the title property?
- What are operators?
- What is the fromCharCode method?