JavaScript replace() Function Example

JavaScript concat() function concat two strings value.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title>JavaScript str.concat() function</title>
</head>
<body>
    <script type="text/javascript">
        var str1 = "Hello ";
        var str2 = "Student";
        document.write(str1.concat(str2));
    </script>
</body>
</html>

Run it...   »

Example Result