fix(curriculum): change Guest to null in prompt lecture (#65770)
Some checks failed
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - DOCR Cleanup Container Images / Delete Old Images (learn-api, dev) (push) Has been cancelled
CD - Docker - DOCR Cleanup Container Images / Delete Old Images (learn-api, org) (push) Has been cancelled
i18n - Download Client UI / Client (push) Has been cancelled

This commit is contained in:
Aditya Singh 2026-02-09 18:54:03 +05:30 committed by GitHub
parent d6db37d423
commit cf47ffaa0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,7 @@ btn.addEventListener("click", () => {
In this example, when the user clicks on the button, the `prompt()` method displays a dialog box with the message `What is your name?` and an input field that initially contains the value `Guest`.
If the user types their name and presses "OK", the `userName` variable will store the entered value. If the user presses "Cancel," the `userName` variable will be set to `null`. `null` signifies that the user did not provide any input. The output paragraph will then display a greeting message using the provided name or `Guest` if the user canceled.
If the user types their name and presses "OK", the `userName` variable will store the entered value. If the user presses "Cancel," the `userName` variable will be set to `null`. `null` signifies that the user did not provide any input. The output paragraph will then display a greeting message using the provided name or `null` if the user canceled. You will learn techniques to avoid displaying `null` when a user cancels the prompt in future lessons.
Keep in mind that the `prompt()` method will halt the execution of the script until the user interacts with the dialog box.