Last active
August 29, 2015 14:25
-
-
Save TheBeege/fef29ace6834b9d413c9 to your computer and use it in GitHub Desktop.
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
var x = prompt("Type something at me"); | |
if (x.indexOf("1") != -1 && x.indexOf("$") != -1 ) { | |
alert("You entered both a 1 and a $."); | |
} else if ( x.indexOf("1") != -1 ) { | |
alert("You entered only a 1"); | |
} else if ( x.indexOf("$") != -1 ) { | |
alert("You entered only a $"); | |
} else { | |
alert("Congrats you entered neither a 1 nor a $."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Haven't actually tested. Too lazy. Should look something like this, though.