Design & Download
Your JS Library
in Seconds!!!

Snippet: testAll()

Written by Christopher West (cwest) on August 07, 2017.
Test all array values or object properties and return if all of them were good.
function testAll(subject, fnTest) {
  fnTest = getSimpleCallback(fnTest);
  return walk(subject, function(value, index) {
    if (!fnTest(value, index, subject)) {
      this(false);
    }
  }) >= 0;
}