How to concatenate two strings in JavaScript
In this post we will give you information about How to concatenate two strings in JavaScript. Hear we will give you detail about How to concatenate two strings in JavaScriptAnd how to use it also give you demo for it if it is necessary.
we are going to learn about how to concatenate two strings in JavaScript.
JavaScript offers us three different ways to concatenate or joining strings.
The first way is using the plus + operator to join two strings.
const str1= "After ";const str2 = "noon";const combine = str1+str2;console.log(combine); // After noon
The second way is using the string interpolation with the help of es6 string literals.
const combine = '${str1} ${str2}';
The third way is using the += operator to assign a string to the existing string.
let str1 = "After ";str1 += "noon"console.log(str1); // "After noon"
Hope this code and post will helped you for implement How to concatenate two strings in JavaScript. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs