Discuss / JavaScript / homework

homework

Topic source

importNew_yy

#1 Created at ... [Delete] [Delete and Lock User]
  return arr.map(function(x){
        return x = x[0].toUpperCase()+x.substring(1).toLowerCase();

    });

importNew_yy

#2 Created at ... [Delete] [Delete and Lock User]
return arr.filter(function(x){
        if( x <= 1) return false;
        for(var i = 2;i <= x/2;i++){
            if((x % i) === 0) return false;
        }
        return true;
    });

  • 1

Reply