Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

skip map iteration javascript

var values = [2, -1, -2, 7, 3, 5]
var filtered = values.map(function(num){
  if (num > 0) 
  {
      return num;
  }
  else {
      return 0;
  }
});
 
PREVIOUS NEXT
Tagged: #skip #map #iteration #javascript
ADD COMMENT
Topic
Name
3+8 =