|
contains
Overview of contains
containsAction that checks if one thing contains another. Usage(boolean) objx( object ).contains(check [, behaviour]);
ArraysThe most common use of contains is to check to see if an array contains a specific item. objx([1,2,3,4,5]).contains(3); // returns true objx([1,2,3,4,5]).contains(6); // returns false StringsYou can check to see if one string contains another. objx("Hello world!").contains("world");
// returns true
objx("Hello world!").contains("monkey");
// returns falseNumbersYou can check to see if a number is contained within another (i.e. is it equal to or less than the value?) objx(10).contains(1); // return true objx(10).contains(11); // returns false | ||||||
► Sign in to add a comment