Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const data = [1, 2, 3];
- const alice = [1, 2, 3];
- const bob = [3, 2, 1];
- let scoreAlice = 0,
- scoreBob = 0;
- for (let i = 0; i < data.length; i++) {
- alice[i] > bob[i] ? scoreAlice++ : alice[i] < bob[i] ? scoreBob++ : "";
- }
- console.log([scoreAlice, scoreBob]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement