Function problem

I cannot get the following code error free, please see below. currently vscode states that a ; or { is expected instead of the = in function let (result) = (win,failure,draw) => {
really I am a beginner and can’t figure it out, can anyone point me in the right direction?

let humanScore = 0;
let computerScore = 0;
let currentRoundNumber = 1;

// Write your code below:
function let (result) = (win,failure,draw) => {
    win = (humanScore > computerScore)
    console.log('human winner');
    failure = (computerScore > humanScore)
    draw = (computerScore === humanScore)
   if (failure){ 
       console.log ('try again');
   } else {

return result

I edited your post to remove the skeleton content, and to format your code. Please review the instructions found here.

You should review functions in general. You are mixing syntax styles together. You can declare a function using the function keyword, or you use a function expression, or an arrow function, but you can’t mix them together.

function myFunction(parameter1, parameter2){
  // code

// or
const myFunction = function(parameter1, parameter2){
 // code

// or
const myFunction = (parameter1, parameter2) => {
  // code
1 Like

—> function result(win, failure, draw) {
—> const result=(win, failure, draw)=> {

also your return at the bottom
return result() <------ return keyword is not needed outside of main function it pertains to
result() // standard way
console.log(result()) // can be used also to test.