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
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week