Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js concat string

const str1 = 'Hello';
const str2 = 'World';

console.log(str1.concat(' ', str2));
// expected output: "Hello World"

console.log(str2.concat(', ', str1));
// expected output: "World, Hello"
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #concat #string
ADD COMMENT
Topic
Name
6+3 =