Skip to content

Commit da03102

Browse files
sosukesuzukiptomato
authored andcommitted
Add test for array.flat(undefined)
1 parent 0782a3f commit da03102

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/built-ins/Array/prototype/flat/non-numeric-depth-should-not-throw.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ depthNum = '1';
4141
actual = a.flat(depthNum);
4242
expected = [1, 2]
4343
assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected');
44+
45+
// undefined depthNum uses the default value of 1
46+
actual = a.flat(undefined);
47+
expected = [1, 2];
48+
assert.compareArray(actual, expected, 'a.flat(undefined) uses default depth of 1');

0 commit comments

Comments
 (0)