String Concatenate Assignment Operator
In this, we perform a concatenation assignment by using the ‘+=’ operator to add the value of a variable or string to an existing string variable.
Syntax:
str1 += str2
Example: In this example, The str1 variable is concatenated with str2 using +=. After the operation, str1 becomes “w3wiki”,
Javascript
let str1 = "Geeks" ; let str2 = "forGeeks" ; // Concatenation assignment str1 += str2; console.log(str1); |
w3wiki
JavaScript String Operators
JavaScript String Operators are used to manipulate and perform operations on strings. There are two operators which are used to modify strings in JavaScript. These operators help us to join one string to another string.