Skip to content

abdalla/ie-array-filter-polyfill-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ie-array-filter-polyfill

Polyfill to provide array.filter on IE < 9

Installation

To install the stable version:

npm install ie-array-filter-polyfill --save

Use

import "ie-array-filter-polyfill";

Example

'use strict';
require('ie-array-filter-polyfill');

const people = [
    {
        name: 'Joe Due',
        age: 35
    },
    {
        name: 'Parker Manson',
        age: 75
    },
    {
        name: 'Junior Manson',
        age: 20
    },
    {
        name: 'Baby Due',
        age: 3
    },
];

const folks = people.filter(x => x.age > 1 && x.age <= 20 );

console.log('FOLKS: ', folks);
>node example.js

//RESULT
FOLKS:  [
	{ name: 'Junior Manson', age: 20 },
  { name: 'Baby Due', age: 3 }
]