Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let passArr = [
- [1, 2, 3, 4, 5],
- [2, 2, 3, 4, 5],
- [3, 2, 3, 4, 5],
- [4, 2, 3, 4, 5],
- [5, 2, 3, 4, 5]
- ]
- let noPassArr = [
- [1, 2, 3, 4, 5],
- [2, 2, 3, 4, 5],
- [3, 2, 3, 4, 5],
- [4, 2, 3, 4, 5],
- [6, 2, 3, 4, 5]
- ]
- let checker = arr =>
- arr.reduce((acc, x) => acc + x[0], 0) ===
- arr[0].reduce((acc, x) => acc + x, 0)
- console.log(checker(passArr))
- console.log(checker(noPassArr))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement