Skip to content

this-keyword: answer ambiguous. Can be undefined #154

@senocular

Description

@senocular

Describe the bug

The result of the function in the question can be either window or undefined but the question only accepts window as a correct answer. Here's an example of the same code producing undefined: https://senocular.github.io/tests/function-context/

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://quiz.typeofnan.dev/this-keyword/
  2. Click on undefined
  3. Click on submit

Expected behavior
Answer is correct or question goes into more detail about the environment beyond just being in the browser that explicitly rules out situations where it may be undefined (i.e. strict mode).

Desktop (please complete the following information):

  • OS: Mac
  • Browser chrome
  • Version 78

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions