3 ms·
Just to clarify, if you update toReadableNumber to take a second parameter and that parameter is not a number, typescript will complain.* TypeScript won't catc
by xsmasher 6y ago
Just to clarify, if you update toReadableNumber to take a second parameter and that parameter is not a number, typescript will complain.*
TypeScript won't catch the original landmine because it ignores the extra parameters; maybe some linter would? Is there a rule that enforces "functions used by map must spell out all the parameters?"
* Example of typescript giving an error on toReadableNumber_v2:
https://www.typescriptlang.org/play?#code/FAYw9gdgzgLgBAQwE5IQTzgXjgbQIwA0ATAQMwC6A3MDQGYCuEIMAlpHDGAEoCmCAJggBGAGx4A5egFshPJAAoI0gFxKZcgJQBvYHD1wkPGPSQQ4agHScAYiwAePfvKIbqAXxrAGTVu068BYTFJdSQAfQA3IkUVNVkkAjgAB0Nae2VYJBYIAHNtXX1DY1Nk1Ps4AGpzaSswWwcnF3cacGgwMQsRMBz5RBR0CykEJN7-PkFRCWl4uA1Z6hbIKHaeTu7e5FQ0QeHR7nGgqdDIoln5miA https://www.typescriptlang.org/play?#code/FAYw9gdgzgLgBAQwE5...