0

I'm trying to access the variable c that is initialized inside myFunc when I call sum.

let sum = (a,b) => {
    let result = a + b + c;
    return result;
}

function myFunc(){
    let c = 5;
    return sum(1,2);
}

console.log(myFunc());

But I'm getting an error because of the c that I use inside the arrow function. Don't know if I'm explaining right but I think you get the point by seeing the code above.

Cratz
  • 1

0 Answers0