Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Erik L
Full Stack JavaScript Techdegree Graduate 19,470 PointsHaving trouble in this project
Hello I am having trouble in this project: https://github.com/SpaceXar20/FSJS-techdegree-project-4-b, I am struggling in 2 things:
-first all of all, when a player guesses a letter right from my phrase, only the correctly guessed should be revealed, not the whole thing. I have a phrase array in game.js and
this is the method that controls how a phrase is revealed, this method is located in phrase.js
// the method below reveals the letter(s) on the board that matches player's selection.
showMatchedLetter() {
//if there was a match on the checkLetter method, then add a show letter class
$('.letter').addClass('show letter');
// //give phrase array a variable to have a reference to it
// const phraseArray = this.phrase;
// /*use a forEach method to loop through the array of Phrase characters,
// and compare each char to the letter that was selected by the player.
// */
// phraseArray.forEach(element => {
// console.log(element)
-second: when I reload a page my phrases are duplicating in the game, but when I wrote my phrase array I separated each one with a comma
this.phrases = ["life is strange","success does not come easy", "seven swans swimming", "guess the word", "wild goose chase"];
I am having trouble debugging as there are no console errors, could someone please take a look and help????