HTML Compiler Online
Javascript Online Compiler
index.html
Change Theme
Compress code
Format code
Download Code
Clear Code
Copy Code!
RunĀ
ctrl+s or click
Output
<!Doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Article - concat in JavaScript 2</title> </head> <body> <h2>concat Method in JavaScript to concatenate strings.</h2> <p>Press <kbd>F12</kbd> to open the console and see the output of the program.</p> <script> const arr = ["Hello", " ", "World", "!"]; console.log("".concat(...arr)); // "Hello World!" console.log("".concat([1, 2, 3])); // "1,2,3" console.log("".concat([])); // "" console.log("".concat({})); // [object Object] console.log("".concat(null)); // "null" console.log("".concat(true)); // "true" console.log("".concat(10, 20)); // "1020" </script> </body> </html>
RunĀ
x
x