Thank you Bro, I am learning JS using your tutorials
@MrTitanfr2 жыл бұрын
hey bro...love your work man...i` m learning so much from you...thanks for the time and effort plz keep up the good work...bless you
@Customkettlesdublin2 жыл бұрын
this video earned my sub, making everything so simple to follow . wasnt working for like 5 mins thought i wasted time but just my script tag was inside my div :))
@mayowafalomo13992 жыл бұрын
You didn't disappoint me when i needed this video, Thank you soo much.
@joshuwa39532 жыл бұрын
How can we implement a score tracker for this ?
@iitzrohan Жыл бұрын
Here's How i did it. const playerScore = document.getElementById("playerScore"); const computerScore = document.getElementById("computerScore"); let result; let countplayer = 0;; let countComputer = 0; choiceBtns.forEach(button => button.addEventListener("click", () => { computerTurn(); player = button.textContent; playerText.textContent = `Player: ${player}`; computerText.textContent = `Computer: ${computer}`; result = checkWinner(); resultText.textContent = result; if (result == "You Win!") { countplayer += 1; playerScore.textContent = countplayer; } if (result == "You Lose!") { countComputer += 1; computerScore.textContent = countComputer; } }));
@diegoserrano8302 Жыл бұрын
thank you for the video i have a deadline for a project coming and this helped me a lot!!
@dianadoroi1542 жыл бұрын
Thank you so much for your work!
@lucabinder98292 жыл бұрын
I have already watched 87 videos for JavaScript. All from you.
@kmdoll2 жыл бұрын
for the youtube algorithmmmm
@cashvillekid988 ай бұрын
The check winner function doesn't check all possible conditions...like what if computer chooses paper and the player chooses rock?
@kwazeo2 жыл бұрын
You are the best! :D
@josephquezada6138 Жыл бұрын
hey you never used the result variable, also why did you put *3 + 1?
@agent-33 Жыл бұрын
Good eye. The result variable is unused and must be removed from the code. The Math.random() * 3 + 1 within Math.floor() will produce number from 1 to 3. You might be confused what is the point of + 1 there, to understand this, we must understand what the code Math.random() alone, can produce. Math.random() returns a float from 0.00000 to 0.999999, in other words, it gives 0 to less than 1. If we use Math.random() * 3, this will produce numbers from 0.000000 to 2.999999. If we put it inside Math.floor(), it will remove the decimals so the result will range from 0 to 2. Actually, this should be enough to produce what we want, 3 different numbers: 0, 1, 2. But the coder want a number range from 1~3 (1, 2, 3) so he put + 1 to offset the result of random number by additional 1.
@Maha-sj2qx Жыл бұрын
how come the results variable is never used but it is declared?
@MacN_ Жыл бұрын
Hiya, thank you for your videos! I completed this program, however my machine didn't like a section of code. Here is the error message: uncaught typeError: "choiceBtns.forEach" is not a function. line 9. running through VS code, live server. Other than that the program looks how it should. Thank you, MacN (anonymous)
@MacN_ Жыл бұрын
any suggestions to remedy are appreciated.
@TacNral Жыл бұрын
@@MacN_ Hi, I have experienced the same problem, if you haven't found and answer yet it might be because it needs to be querySelectorAll instead of querySelector
@yy.u.i Жыл бұрын
@@TacNralThank you. I had the same problem, but after adding the 'All' it was resolved
@nemeandragon9062 Жыл бұрын
I tried following along and doing it myself but I couldn't get the live server to work as it should... After copying your code completely, the web page still doesn't react whenever I click on the buttons. Wondering if I have something incorrectly configured inside of VS code?
@mst3ksanta2 жыл бұрын
I haven't played htis version of pokemon for a long time
@малосольные-окурки7 ай бұрын
great video! lesgo!
@sherezali9691 Жыл бұрын
thanksssssssssssssssssssssssssss brother🥰🥰🥰
@shaneforde56132 жыл бұрын
Great for beginners
@sayyedshoeib71072 жыл бұрын
how to find ho is winner after the player or computer point is 5,10 final result
@Islamicway68552 жыл бұрын
Which software you use for this?
@tintedclown48762 жыл бұрын
Visual studio code
@edisonviolante11 ай бұрын
Could someone helpme out about this code? I would like to improve it with an total score in the corner and switching the "Player" name for the real name when acessing the page (Idk if by prompt would be a good choice)
I prefer to code rock paper scissors in f*ing unity than this 💀
@Cloud_with_lois Жыл бұрын
nobody cares
@ShadowedSpectre Жыл бұрын
shut up. You just dont know how to code in REAL programming languages💀💀💀
@sayyedshoeib71072 жыл бұрын
awosome
@sarthakladfacts945 Жыл бұрын
❤❤
@pranayshelke86662 жыл бұрын
Thanks budyy
@thehoeynator2 жыл бұрын
I followed it step for step and it didn't work
@secretsdowntherain58942 жыл бұрын
same here
@rolando8966 Жыл бұрын
It looks like he added an “s” to “Btn” in JavaScript…. But not in HTML… that might be why
@rolando8966 Жыл бұрын
Or maybe u pressed you put a “single quote “ vs a “backTick” it’s the button above “tab” key
@rolando8966 Жыл бұрын
At 6:28 min mark
@percussion19993 ай бұрын
Hii😊
@shubhangichavan69252 жыл бұрын
for yt
@Gunz1234 Жыл бұрын
fix for the Uncaught TypeError: choiceBtn.forEach is not a function const choiceBtn = document.getElementsByClassName("//urID"); Array.from(choiceBtn).forEach(button => button.addEventListener("click", () => { player = button.textContent; computerTurn(); playerText.textContent = `Player: ${player}`; computerText.textContent = `Computer: ${computer}`; resultText.textContent = checkWinner(); })); basically add Array.from().forEach put values and it will work
@Mrmeepdev Жыл бұрын
The value in the video was choiceBtns = document.querySelectorAll('.choiceBtn') and not ChoiceBtn.document.querySelectorAll('.choiceBtn') You probably had a TypeError when writing the forEach function