Why doesn't this work?

I’ve been following along the video to a tee, however, when I try to test my code I can’t use a comma to separate my arguments?! Please see below. const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === ‘rock’ || userInput === ‘paper’ || userInput === ‘scissors’) {
return userInput;
} else {
console.log(‘Error!’);
}
}
const getComputerChoice = () => {
const randomNumber = Math.floor(Math.random() * 3);// you NEEDED TO CREATE IT AS A VARIABLE OMFG
switch (randomNumber) {
case 0:
return ‘rock’;
case 1:
return ‘scissors’;
case 2:
return ‘paper’;
}
}
const determineWinner = (userChoice , computerChoice) => {
if (userChoice === computerChoice){
return ‘this game is a tie’
}
if (userChoice === ‘rock’) {
if (computerChoice === ‘paper’)
return ‘Sorry, computer won!’
} else {
‘Congratulations, you won!’
}
if (userChoice === ‘paper’) {
if (computerChoice === ‘scissors’)
return ‘Sorry, computer won!’
} else {
‘Congratulations, you won!’
}
if (userChoice === ‘scissors’) {
if (computerChoice === ‘rock’)
return ‘Sorry, computer won!’
} else {
‘Congratulations, you won!’
}
}
console.log(determineWinner(‘rock’,‘scissors’)); // try this code, the comma doesn’t allow me to turn the scissors into a string,

PLEASE HELP
Also recommendations on videos and more guides is also appreciated. Thank you so much !

Hello @experimentalreality, welcome to the forums! What do you mean, the comma doesn’t allow me turn the scissors into a string? Could you please format the code correctly; see this thread.

`const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === 'rock' || userInput === 'paper' || userInput === 'scissors') {
  return userInput;
} else {
  console.log('Error!');
}
}
const getComputerChoice = () => {
 const randomNumber = Math.floor(Math.random() * 3);// you NEEDED TO CREATE IT AS A VARIABLE OMFG
switch (randomNumber) {
  case 0:
  return 'rock';
  case 1:
  return 'scissors';
  case 2:
  return 'paper';
}
}
const determineWinner = (userChoice   , computerChoice) => {
if (userChoice === computerChoice){
  return 'this game is a tie'
}
if (userChoice === 'rock') {
  if (computerChoice === 'paper')
  return 'Sorry, computer won!'
} else {
  'Congratulations, you won!'
}
if (userChoice === 'paper') {
  if (computerChoice === 'scissors')
  return 'Sorry, computer won!'
} else {
  'Congratulations, you won!'
}
if (userChoice === 'scissors') {
  if (computerChoice === 'rock')
  return 'Sorry, computer won!'
} else {
  'Congratulations, you won!'
}
}
console.log(determineWinner('rock','scissors'));`
`` This code in my lesson shows scissors ^^ as a variable.

As long as you have the quotation marks around it, don’t worry about the lesson formatting; sometimes the colour coding is just wrong. One thing to point out, why do you just have strings on their own line for all of the else statements in the determineWinner function:

I’m very new to this man! I just made the mistake I guess. Thanks for the feedback. Do you have any resources you’d recommend to help me improve my understanding and the logic behind coding?

The online language docs, in your case, I would say Mozilla docs. But there are some other useful websites out there, like Geeks for Geeks, Stack Overflow, and W3Schools. A website that’s good for practising code is Codewars.