JavaScript String concat() MethodThe JavaScript string concat() method combines two or more strings and returns a new string. This method doesn't make any change in the original string. SyntaxThe concat() method is represented by the following syntax: Parameterstr1,str2,...,strn - It represent the strings to be combined. ReturnCombination of strings. JavaScript String concat() Method ExampleLet's see some simple examples of concat() method. Example 1Here, we will print the combination of two strings. Test it NowOutput: Javatpoint.com Example 2Here, we will print the combination of three strings. Test it NowOutput: Javatpoint.com Tutorials Example 3In the last example, we provided the space between the strings while initializing it. Here, we will perform the similar task through the method. Test it NowOutput: Javatpoint.com Tutorials Next TopicJavaScript String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India