doc: add how to access URL constructor#21928
doc: add how to access URL constructor#21928tim-phillips wants to merge 1 commit intonodejs:masterfrom tim-phillips:patch-4
Conversation
|
It might be worth explicitly mentioning that this only applies up to Node 8, since Node 10 it’s also accessibly as a global? |
In that case, should this PR target |
The v8.x docs include the So I think this PR may be unnecessary? (Or maybe there's an issue where it's not sufficiently clear what version of the docs one is reading on the website?) |
|
I didn’t realize it was global, even though it does mention it in the doc. I was looking specifically for an import statement. Would it be against convention to add |
|
FWIW the |
|
BTW the v8.x docs have |
I don't think we do that anywhere else, but that doesn't mean we can't in this situation or start a general practice along those lines. /pinging @nodejs/documentation @nodejs/website for thoughts |
|
i thought the current practice was to treat the examples as runnable code yea? so if they reference something without require/etc it should be assumed to be a global. |
FWIW, we still have this point in the STYLE_GUIDE:
And we still have many examples with assumed |
|
Given the above comments, I’m closing this. If you think this should be re-opened, please let us know and we’ll be happy to do so! |
It was unclear to me how to access the constructor. This should clear things up for future users.
Checklist