description of radix argument in parseInt calls string "numString", but parseInt header calls it "s" #42741
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Good First Issue
Well scoped, documented and has the green light
Help Wanted
You can do this
Milestone
Bug Report
π Search Terms
numString
π Version & Regression Information
numString
.β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
When calling
parseInt
and filling in its optional second parameter, it says,and the variable name in the description of the
radix
argument,numString
, does not match the parameter name of thestring
inparseInt
's function header,s
.π Expected behavior
For consistency, I think the variable name in the description for the
radix
parameter,numString
, should match the parameter variable name inparseInt
's function header,s
. Two possible solutions are renamingparseInt
's first, string parameter variable name froms
tonumString
, or renaming the variable in theradix
parameter argument's description fromnumString
tos
.If this is something we can change, I would like to contribute the fix for it.
I realize this issue isn't really severe at all: on a scale from 1 to 10, where 1 is hardly severe at all, and 10 is very severe, this would be a 1. I just point it out because it might be helpful to use the same name to refer to the same variable, instead of calling it
s
in the function header andnumString
in the description of theradix
argument.I did a bit of research before creating this issue and saw that MDN calls
parseInt
's string parameterstring
, and refers to that parameter in the description of theradix
argument asstring
, being consistent.I also looked at the ECMAScript 2015 specification for
parseInt
, but they don't refer to the string parameter from a description of the radix parameter, so the naming inconsistency issue I'm mentioning here isn't present there.Similarly, an annotated ES5 specification for
parseInt
doesn't have a naming inconsistency for the first, string argument ofparseInt
that I noticed.The text was updated successfully, but these errors were encountered: