diff --git a/snippets/ary.md b/snippets/ary.md index eb0735111..6f988d4d3 100644 --- a/snippets/ary.md +++ b/snippets/ary.md @@ -13,5 +13,5 @@ const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); ```js const firstTwoMax = ary(Math.max, 2); -[[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10] -``` \ No newline at end of file +[[2, 6, 'a'], [6, 4, 8], [10]].map(x => firstTwoMax(...x)); // [6, 6, 10] +``` diff --git a/test/ary.test.js b/test/ary.test.js index 465c7a2db..c48b2d1ac 100644 --- a/test/ary.test.js +++ b/test/ary.test.js @@ -5,5 +5,5 @@ test('ary is a Function', () => { }); const firstTwoMax = ary(Math.max, 2); test('Discards arguments with index >=n', () => { - expect([[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x))).toEqual([6, 8, 10]); + expect([[2, 6, 'a'], [6, 4, 8], [10]].map(x => firstTwoMax(...x))).toEqual([6, 6, 10]); });