- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements
To Continue Learning Please Login
Login with Google