cf.completefrontend

Predict the outputHard

Which of these calls keep this: parentheses, the comma operator, or an assignment?

What does this log?
var id = "global";
 
const outer = {
  id: "outer",
  inner: {
    id: "inner",
    getId() {
      return this.id;
    },
  },
};
 
const { inner } = outer;
 
console.log(outer.inner.getId());
console.log(inner.getId());
console.log((outer.inner.getId)());
console.log((0, outer.inner.getId)());
console.log((inner.getId = inner.getId)());

The answer

Work out every line it logs, in order. Then check.

Checking your sign-in…