Workshop › Hangman › Step 10 of 36
A guess is one letter. guess(letter) adds it to the Set; the loop then shows it wherever it is in the word.
```js
function guess(letter) {
guessed.add(letter)
}
```letter is a parameter: whatever we pass in guess('A') is letter inside the function.guessed.add(letter) puts the letter in the Set. Adding a letter that is already there changes nothing.Write guess under the newWord function, with an empty line between them. Press Run.
Skills: Functions, Game states
← Draw again and again Guess with the keyboard →