jQuery grep()

Read the tutorial on YogiHosting »

1. Filtering array - numbers greater than 5

Array is [1, 2, 3, 4, 5, 6, 6, 1, 7]

2. Filtering array with "Invert" true- numbers greater than 5

Array is [1, 2, 3, 4, 5, 6, 6, 1, 7]

3. Filtering array - numbers greater than 2 and index less than 5

Array is [1, 2, 3, 4, 5, 6, 6, 1, 7]

4. Filtering JSON

The JSON is:
[ { "Product": "Mini Skirt size 28", "Color": "Brown", "Price": "$30.87" }, { "Product": "Pant size 47", "Color": "Brown", "Price": "$30.87" }, { "Product": "Pant size 37", "Color": "Black", "Price": "$26.75" }, { "Product": "Coat size 48", "Color": "Orange", "Price": "$105.60" } ];