5 ms·
Or you end up with java-like names once you forgot the option object. toReabableNumber, toReadableNumberWithBase, toReadableNumberWithBaseAndPrecision, .... or
by tetha 6y ago
Or you end up with java-like names once you forgot the option object. toReabableNumber, toReadableNumberWithBase, toReadableNumberWithBaseAndPrecision, .... or I guess toReabableNumberWithOptions.
- simongray 6y agoIsn't that more Objective-C style?
- wruza 6y agoAaand in objc, it would traditionally be: [array mapSelector:@selector(toReadableNumber:withOptions:) fromObject:[NSFormattingManager localizedFormattingManager] withArguments:@[@{kCFNumberFormattingBaseKey:@(10)}]]; Thank god they invented @-syntax for core type literals.
- hawk_ 6y agouhm java has method overloading..
- vorticalbox 6y agoSo does javascript.
- Toutouxc 6y agoI believe that JS doesn't have function overloading. Function overloading, the way I understand it, is the ability to declare multiple functions with the same name but a different signature (different tuple of arguments) and let the runtime/compiler decide upon the implementation used.
- vorticalbox 6y agoJavaScript supports this here is a snippet from out sdk https://pastebin.com/xCnY8ZzV https://pastebin.com/xCnY8ZzV
- emteycz 6y agoThat's TypeScript and it works only with type signatures, you still have only one actual implementation.