The problem is that you return undefined in the event that Australia is batting, and 15 + undefined evaluates to NaN.
Also: Please create a working example in the future. I was able to just eyeball this one, but there is no way for me to check if my solution actually works. You are far far more likely to get help if you create a working example.
Asked in February 2016Viewed 1,243 timesVoted 6Answered 1 times