Still don’t get it how

I still don’t get it how
const removed = newItemTracker.pop();
invoked/called newItemTracker.pop()

The method is invoked in the assignment, and the last element value assigned to the removed variable. The parens do the job.

thanks for taking the time to answer!! really appreciate it

but the thing I don’t seem to understand is that below
const removed = newItemTracker.pop();

“newItemTracker.pop();” expression is on the right side, so whatever it does gets assigned to the left side “const removed” expression. After which the variable removed is equal to the last item. But am I getting it right that even if you write it on the right side, it still gets called. For example,
let x = f(y) not only assigns the value of f(y) to x but also calls f(x) ?

The pop method removes the last item from an array, and permits us to assign the singular value to a variable or use it in an expression.

a = "abcdefghijklmnopqrstuvwxyz".split("")
log = x => {
    console.log(x)
}
a.forEach(log)
console.log(a)

The array is still intact since all we did was iterate over it and log each element. Now let’s take it down.

a = "abcdefghijklmnopqrstuvwxyz".split("")
log = () => {
  console.log(a.shift())  // same as pop but from the front
}
a.slice().forEach(log)
console.log(a)

This is demonstration code, only to see the mechanics. We have decimated the original array, not as we iterate it, but as we iterate a copy. Nothing messes with a loop like removing elements during iteration.