Hasan Setiawan

Write, write, write give your wings on code!

Follow me on GitHub

Array Filter in JavaScript

Array filter in JavaScript

Array filter will return an array contains filtered data, after filtered by your filter definitions

Here is the code:

              
                function isBigEnough(value) {
                  return value >= 10;
                }
                var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
                // filtered is [12, 130, 44]