Created
May 22, 2017 00:17
-
-
Save cmoscardi/c422cc152d36b0e0939c9006ffe6bd3f to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=c422cc152d36b0e0939c9006ffe6bd3f
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>What Did You Click?</title> | |
</head> | |
<body> | |
<!-- Put your page markup here --> | |
<h1>Do Now</h1> | |
<p>You should alert the user whether or not the letter is in the word.</p> | |
<p>To see if a letter is in a word, you can use | |
</p> | |
<pre> | |
var letter = "a"; | |
var word = ["h", "a", "t"]; | |
// this would be true | |
word.includes(letter); | |
//so , we could do | |
if(word.includes(letter)){ | |
// console.log("yes the word does include the letter"); | |
}) | |
</pre> | |
</body> | |
</html> |
This file contains hidden or 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
{"enabledLibraries":["jquery"],"hiddenUIComponents":["editor.css"]} |
This file contains hidden or 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 word = ["h", "e", "l", "l", "o"]; | |
function onKeyDown(event) { | |
var key = event.key; | |
//alert("the key is " + key); | |
//alert("the word is " + word); | |
alert("is " + key + " in " + word + " ??????"); | |
} | |
$("body").keydown(onKeyDown); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment