String Concatenate Operator
Concatenate Operator in JavaScript combines strings using the ‘+’ operator and creates a new string that includes the contents of the original strings in which Concatenate string1 and string2, ensuring the first character of string2 immediately follows the last character of string1.
Syntax:
str1 + str2
Example: In this example, we are Concatenating str1 and str2 using the ‘+’ operator, the result variable holds the string “w3wiki”.
Javascript
let str1 = "Geeks" ; let str2 = "forGeeks" ; let result = (str1 + str2); console.log(result); |
Output
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.
Contact Us