Skip to content

Instantly share code, notes, and snippets.

@tangoabcdelta
Created March 16, 2021 20:22
Show Gist options
  • Save tangoabcdelta/0861c416c8abcbe9311225cd056d19e3 to your computer and use it in GitHub Desktop.
Save tangoabcdelta/0861c416c8abcbe9311225cd056d19e3 to your computer and use it in GitHub Desktop.
guess the output questions
console.log(
  (x = {
    a: 10,
    b: () => this.a,
    c: function() {
      return this.a;
    },
  }) && x.b(),
  x.c(),
  (bb = x.b) && bb(),
  (cc = x.c) && cc()
);

output:

undefined 10 undefined undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment