javascript-koans icon indicating copy to clipboard operation
javascript-koans copied to clipboard

update "any" to "some" in AboutHigherOrderFunctions.js

Open sarahbkim opened this issue 12 years ago • 2 comments

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?

sarahbkim avatar Dec 14 '13 19:12 sarahbkim

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()"?

gregmalcolm avatar Dec 19 '13 15:12 gregmalcolm

@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 :).

choskim avatar Dec 16 '15 05:12 choskim