Skip to content

Instantly share code, notes, and snippets.

@joa
Created August 1, 2014 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joa/129a79422314f7fc22b1 to your computer and use it in GitHub Desktop.
Save joa/129a79422314f7fc22b1 to your computer and use it in GitHub Desktop.
Little JavaScript gem I found
// what does the following code print?
//
// a) false, true
// b) true, true
// c) true, false
// d) none of the above
console.log(new Option() instanceof HTMLOptionElement)
console.log(new HTMLOptionElement() instanceof HTMLOptionElement)
@ooflorent
Copy link

Same result with Image and HTMLImageElement.
Had experienced it today 😉

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