How to use concat() to combines text of two or more strings and returns a new string in JavaScript

3 Answers

0 votes
var s = 'Online Cloud Products';

document.write(s.concat(' JavaScript'));


/*
run:

Online Cloud Products JavaScript 

*/

 



answered Aug 9, 2016 by avibootz
0 votes
var s = 'Online Cloud Products';

var s1 = s.concat(' JavaScript');
document.write(s1);


/*
run:

Online Cloud Products JavaScript 

*/

 



answered Aug 9, 2016 by avibootz
0 votes
var s = 'Online Cloud Products';

var s1 = s.concat(' JavaScript', ' PHP', ' C');
document.write(s1);


/*
run:

Online Cloud Products JavaScript PHP C 

*/

 



answered Aug 9, 2016 by avibootz
...