what is your goal with this thread?
do you want help to fix something? do you want feedback?
please say something, otherwise this is just a link with no contest and so spam
I guess I just waned feedback , for anyone to critique my code , the code does what it should but i’m not proficient in javascript , I feel llike its a hack job. I feel like i could have used a for loop or a while loop in the code but I’m not good at those, so critique away!
I guess my suggestion would be to never repeat yourself. write one function so that all you have to do is enter the appropriate arguments so all you have to do is call that one function instead of repeating. this makes your code easy to read and debug
avoid
# when paper clicked
let clickPaper = () => {
decision.push('P')
whoWins();
reset();
}
# when scissors clicked
let clickScissors = () => {
decision.push('S')
whoWins();
reset();
}
better
const click = (choice)=>{
descision.push(choice)
whoWins();
reset()
# usage
click('S')
click('P')
ps. use const
when ever possible. only use let for variables where you know the values will change