3 ms·
Seems like a very normal parameter choice for such a function. Nearly every one of the "big" programming languages uses this in some way. To me it would seem we
by ketzu 3y ago
Seems like a very normal parameter choice for such a function. Nearly every one of the "big" programming languages uses this in some way. To me it would seem weird to have a parseInt and parseIntBase when one is just parseInt(x) -> parseIntBase(x, 10)
C++: https://en.cppreference.com/w/cpp/string/basic_string/stol https://en.cppreference.com/w/cpp/string/basic_string/stol
Java: https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#parseInt-java.lang.String-int- https://docs.oracle.com/javase/8/docs/api/java/lang/Integer....
C#: https://learn.microsoft.com/en-us/dotnet/api/system.int32.parse?view=net-7.0#system-int32-parse(system-string-system-globalization-numberstyles) https://learn.microsoft.com/en-us/dotnet/api/system.int32.pa...
But they don't have implicit null/undefined for unspecified parameters, and afaik the map's in these languages do not provide additoinal parameters.
- deleted 3y ago[deleted]