Javascript examples for Array:join
Join filtered item from an array
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w .j ava2 s . c o m var myarr = ["red", "green", "blue", "yellow"]; var result = myarr.filter(function (item) { return item != "red"; }).join(""); console.log('result', result); document.body.innerText = result; } </script> </head> <body> </body> </html>