
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
Explain about add and assignment(+=) operator in detail in javascript?
add and assignment(+=) operator
The add and assignment(+=) operator reduces the code little bit.It may not much influential in small codes whereas coming to long codes it's use can't be ignored.
Example
<html> <body> <script> var tot = 0; var a = [1,45,78,9,78,40]; for(var i = 0; i<a.length;i++){ tot += a[i] } document.write(tot); </script> </body> </html>
Output
251
- Related Articles
- Explain about logical not(!) operator in detail with example in javascript?
- Explain in detail about memory leaks in JavaScript?
- Explain in detail about Mark and Sweep algorithm in JavaScript?
- Explain in detail about Reference-counting garbage collection in JavaScript?
- Explain in detail about the memory life cycle of JavaScript?
- What is Assignment Operator (=) in JavaScript?
- What is Unary Plus Operator in JavaScript?
- What is Multiplication Assignment Operator (*=) in JavaScript?
- What is Addition Assignment Operator (+=) in JavaScript?
- Explain the concept of logical and assignment operator in C language
- What is Bitwise OR Assignment Operator (|=) in JavaScript?
- What is Bitwise XOR Assignment Operator (^=) in JavaScript?
- Explain Force in detail
- Explain sound in detail.
- Define Cell, and explain it in detail.

Advertisements