var a=[1,2,3,4]
console.log(a)
var b=a.map(
    function(x){
        return x+1;
    }
  )
console.log(b) 

var c=a.filter(
    function(x){
        return x%2==0;
    }
  )
console.log(c) 

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: