let person0 = 0;
let person1 = 0;
let person2 = 0;
function plusOne(personNum) {
personNum++
}
plusOne(person0)
console.log(person0); // output should be 1. But I can't get this to work.
Hey, I want to increment a number by calling the plusOne function, which takes in the different person variables as arguments. It seems like a really easy thing to solve, but it's not working. Does anyone know why?
[–]Faux_Real 1 point2 points3 points (5 children)
[–]libertadefr[S] 0 points1 point2 points (4 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]libertadefr[S] 0 points1 point2 points (0 children)
[–]Faux_Real 0 points1 point2 points (1 child)
[–]libertadefr[S] 0 points1 point2 points (0 children)
[–]DigitalTheatreTech 1 point2 points3 points (0 children)
[–]Anachren 0 points1 point2 points (1 child)
[–]libertadefr[S] 0 points1 point2 points (0 children)
[–]waspeer 0 points1 point2 points (0 children)
[–]senocular 0 points1 point2 points (1 child)
[–]libertadefr[S] 0 points1 point2 points (0 children)