Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Filtering an array in Javascript

function bouncer(arr) {
  let newArray = [];
  for (let i = 0; i < arr.length; i++) {
    if (arr[i]) newArray.push(arr[i]);
  }
  return newArray;
}
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Filtering #array #Javascript
ADD COMMENT
Topic
Name
4+9 =