How to Combine Two Strings with Concat() Using JavaScript

How do you use the concat() method to combine two strings in JavaScript?
The concat() method concatenates a string argument to the calling string and returns a new string.
In the examples below, we will take two strings and combine them using the concat() method.
Here's the full code:
JavaScript
 
const str1 = "Taco"
const str2 = "Bell"
 
const newString = str1.concat(str2)
// newString = "TacoBell"
And we can add a space between the two words with either of the two methods below:
JavaScript
 
const newString = str1.concat(" ").concat(str2)
// newString = "Taco Bell"
 
const newString = str1.concat(" ", str2)
// newString = "Taco Bell"
As you may have noticed, the concat() method takes a variable number of arguments. And each argument will be concatenated to the original string.
For more information on the concat() method, check out the Mozilla Web Docs on the subject.
Thanks for reading and happy coding!