c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
JavaScript

How to Concatenating string using JavaScript?

| | Html , JavaScript

In this article we will discuss how to concatenating string using JavaScript . Concatenating is achieved by two methods. You could use + operator or by concat() method.

Concatenatingstrings using + operator:

<script type="text/javascript">

    var string1 = "Hello"

    var string2 = "JavaScript"

    var result = string1.concat("", string2);

     alert(result);

    </script>

Concatenating strings using concat() method::

<script type="text/javascript">

    var string1 = "Hello"

    var string2 = "JavaScript"

    var result = string1.concat("", string2);

    alert(result);

  </script>

Output: