New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: <integer> is misleading #33585
Comments
Any clues on what needs to be done to correct this? It seems as though C++ types are being mixed into the JS docs. /cc @addaleax |
We declare a variable as integer in case it should be an integer, not a decimal number. It's still a We might want to stop referencing to JS numbers on MDN. Besides that, I would keep it as is. |
I wonder if it would be more helpful to link to specification in this regard. https://www.ecma-international.org/ecma-262/6.0/#sec-number.isinteger |
I found a nice sentence from the V8 docs supporting my initial thought about them
Since @BridgeAR gave me the lead on this, it would be nice to have his approval |
I would have liked to link to something like the following. https://docs.oracle.com/javase/10/docs/api/java/lang/Integer.html Unsure if linking to the class from the V8 docs would be out of the question. https://v8docs.nodesource.com/node-14.1/df/d84/classv8_1_1_integer.html Or is it too late to create an Integer class, implement it, and document it? I'm not really sure what needs to be done here… (Sorry I couldn't be of more help on this.) |
📗 API Reference Docs Problem
Location
Affected URL(s):
...among others
Problem description
Many methods are documented to take
<integer>
or<integer[]>
. Examples:Buffer.from(array)
emitter.setMaxListeners(n)
It seems to always mean "an integer Number". However, clicking the type link leads to an MDN section that starts with "ECMAScript has two built-in numeric types: Number and BigInt (see below).". One might erroneously think that BigInt, which is also an "integer", works too.
The text was updated successfully, but these errors were encountered: