CodesJava

Easy learning with example program codes

concat() JavaScript JS

The JavaScript string concat() method retrieves a combination of two or more strings. Original strings will not be modified.

Syntax:

string.concat(string1,string2,...) 

Parameters:
string1,string2,…: Represents the different strings to combined.

Return:
New string after combination of strings.

Example:

<!DOCTYPE html>
<html>
<body>
<script>   
document.writeln("HELLO".concat(" WORLD!"));  
</script>
</body>
</html>

Output:

HELLO WORLD!
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status