Skip to main content
3 of 5
added 2 characters in body
user avatar
user avatar

I think you could use regular expressions:

this tests for shoes case insensitive. (match also "shoesprostore")

if (/shoes/i.test(ele.Department)) { } 

this tests for the word shoes case insensitive. (match only "shoes")

if (/\bshoes\b/i.test(ele.Department)) { } 

edit:

this tests for the words shoe and shoes case insensitive.

if (/\bshoes?\b/i.test(ele.Department)) { } 

\b : start and finish of a word

? : the previous character may or may not be present

i (after the sencond /) : case insensitive

look here for more http://www.w3schools.com/jsref/jsref_obj_regexp.asp

:)

edit 2:

corrected grammar inconsistencies thanks to my friend SandMan

user757095