javascript-koans
javascript-koans copied to clipboard
update "any" to "some" in AboutHigherOrderFunctions.js
it("should use 'any' to test if any items passes condition" , function () {
var onlyEven = [2,4,6];
var mixedBag = [2,4,5,6];
var isEven = function(x) { return x % 2 === 0 };
expect(_(onlyEven).any(isEven)).toBe(true);
expect(_(mixedBag).any(isEven)).toBe(true);
});
in lines 60-68 of AboutHigherOrderFunctions.js should be updated to use "some" instead of "any"
it looks like "any" has been deprecated?
Probably true, but then you'd probably have to upgrade underscore and retest all usages of underscore in the koans to make sure the update didn't break them. Unless this version of underscore already supports "some()"?
@sarahbkim: Thanks for leaving a comment. I'll be soon updating the version of Underscore used in this repo. When I do, I'll also update any to some. Also, sorry for this taking a couple of years :).