Skip to content

Commit 9e82ed7

Browse files
committed
Use function definition
1 parent 085410a commit 9e82ed7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

array-flatten.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @param {Number} depth
77
* @return {Array}
88
*/
9-
var flatten = function (array, result, depth) {
9+
function flatten (array, result, depth) {
1010
for (var i = 0; i < array.length; i++) {
1111
if (depth > 0 && Array.isArray(array[i])) {
1212
flatten(array[i], result, depth - 1);
@@ -16,7 +16,7 @@ var flatten = function (array, result, depth) {
1616
}
1717

1818
return result;
19-
};
19+
}
2020

2121
/**
2222
* Flatten an array, with the ability to define a depth.

0 commit comments

Comments
 (0)