JavaScript, like any other language, has the ability to concatenate or join 2 or many more strings.
Now how do we achieve this?
It is something as simple as using the+
operator, suppose we have a string calledname
and a string that isage
what we will do is show in aconsole.log()
a small text thename
andage
.
Alternatively, we can use concat()
, which is a method of the String object, this method returns a concatenated string.
In general, it is advisable to use the simplest form, name + age and take into account the spaces when making concatenations
If the article you liked or you found interesting, please help me with ๐ ๐ค You can follow me on Twitter or find me on GitHub by visiting my website.
Francisco Imanol Suarez on about.me
I am a web developer, student, and photographer in Trelew, Argentina. Read my articles.about.me