function meal(animal) {
animal.food = animal.food + 10;
}
var dog = {
food: 10
};
meal(dog);
meal(dog);
console.log(dog.food);
my question is when you first run the Code
the first function runs first which is
meal(dog);
0=10+10
which would be
20=10+10
when the second function is called it should be
20=10+10
which should be
40=10+10
yet answer is 30
I was expecting 40
not 30
if i can see step by step on whats going on