en.javascript.info icon indicating copy to clipboard operation
en.javascript.info copied to clipboard

clarify typeof alert behavior in non browser environment

Open parthodas23 opened this issue 10 months ago • 1 comments

The current page mentions:

typeof alert // "function"

But in Node.js / VS Code / terminal / online JS runners → alert does NOT exist. So it's gives undefined.

typeof alert // "undefined"

Image

It should mention about the about the Browser Console

typeof alert // "function" (Browser Console)

parthodas23 avatar Jan 25 '26 11:01 parthodas23

I'd like to work on this issue and propose a small documentation update

I'll open a PR with suggested change about the Browser Console

typeof alert // "function" (Browser Console)

parthodas23 avatar Jan 25 '26 11:01 parthodas23