Skip to content

Function prompt should return undefined when cancel is pressed #39

Closed
@martin-henz

Description

@martin-henz

Currently, the return value is null. The null value is not part of Source, so this leaves a weird hole in the specs. I propose to return undefined, so that student can write:
const answer = prompt("What is your answer?");
if (answer === undefined) { .... } else { ... }

Metadata

Metadata

Labels

EnhancementNew feature or requestminorless important than important but more than nice-to-have

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions