Skip to content

Instantly share code, notes, and snippets.

View mrandrewmills's full-sized avatar

Andrew Mills mrandrewmills

View GitHub Profile
@mrandrewmills
mrandrewmills / JavaScript Puzzle One
Created October 15, 2016 18:39
Challenge: Identify the cause of the bug, and fix it by changing only a single line.
var timeValue = "2:00 PM";
var apptTimes = "10:00 AM, 12:00 PM, 3:00 PM";
if (apptTimes.indexOf(timeValue) > -1) {
// selected time has already been added to apptTimes previously
alert("This time has already been added before.");
}