Source: http://www.espn.com/mlb/team/schedule/_/name/wsh/seasontype/2/half/1
Last active
October 11, 2017 00:01
-
-
Save tommymarshall/48efc96d211fcfc37e031bc6885bc31e to your computer and use it in GitHub Desktop.
# of times Nationals won 2 games in a row during the regular season
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// W = a win, L = a loss | |
const records = ['W','W','L','W','L','L','W','W','L','W','L','W','W','W','W','W','W','W','L','W','W','W','L','L','W','L','W','W','W','W','L','L','L','W','W','L','W','W','L','L','L','L','W','W','W','L','W','W','L','W','W','W','W','L','W','W','W','L','W','L','L','L','L','W','L','W','W','W','L','L','W','L','W','W','L','L','W','W','L','L','L','W','W','W','L','W','L','W','W','W','W','W','W','L','L','W','W','L','W','W','L','L','W','W','L','L','W','L','W','W','L','W','W','W','L','W','W','L','W','W','L','W','W','L','W','L','W','L','W','W','W','W','L','L','W','L','W','W','W','W','W','L','W','L','L','W','L','L','W','W','W','L','L','W','W','W','L','L','W','W','L','L']; | |
let last = 'L'; | |
let wins = 0; | |
records.forEach((result) =>{ | |
if (result === 'W' && last === 'W') { | |
wins += 1 | |
} | |
last = result; | |
}); | |
console.log('# of times Nats won 2 games in a row', wins); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment