Skip to content

Commit c83a6e2

Browse files
committed
adjust function to filter out any non-array elements
1 parent f7b2d6f commit c83a6e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Sprint-2/implement/tally.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function tally(array) {
2-
if (typeof array === "string") {
2+
if (!Array.isArray(array)) {
33
throw new Error("Input should be an array");
44
}
55

0 commit comments

Comments
 (0)