From 4ea023dbf705b4c446647dfb92d37d092faaa463 Mon Sep 17 00:00:00 2001 From: brad_Dev <50883158+bsrwilliams@users.noreply.github.com> Date: Tue, 12 Jan 2021 13:51:02 +0000 Subject: [PATCH] Update flatten-array.js Flattened and sorted array --- test/flatten-array.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/flatten-array.js b/test/flatten-array.js index c7f0632..e699460 100644 --- a/test/flatten-array.js +++ b/test/flatten-array.js @@ -2,7 +2,9 @@ describe('flatten array', function () { it('should flatten an array', function () { var arr = [1, 2, [1, 2, [3, 4, 5, [1]]], 2, [2]], expected = [1, 1, 1, 2, 2, 2, 2, 3, 4, 5]; + arr = arr.flat(Infinity); + arr.sort(); expect(arr).toEqual(expected); }); -}); \ No newline at end of file +});