Skip to content

Instantly share code, notes, and snippets.

@TheBeege
Last active August 29, 2015 14:25
Show Gist options
  • Save TheBeege/fef29ace6834b9d413c9 to your computer and use it in GitHub Desktop.
Save TheBeege/fef29ace6834b9d413c9 to your computer and use it in GitHub Desktop.
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 $.");
}
@TheBeege
Copy link
Author

Haven't actually tested. Too lazy. Should look something like this, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment