Bonus: when using many scalars in arguments it can be easy to mix them up.
const f1 = (file: string, folder: string) => { } f1('/tmp', 'foo.txt'); //
spot the error?
A static archive of Markus Tacker's tweets. Follow me on Mastodon: @[email protected].
Bonus: when using many scalars in arguments it can be easy to mix them up.
const f1 = (file: string, folder: string) => { } f1('/tmp', 'foo.txt'); //
spot the error?
const f2 = (args: {file: string, folder: string}) => { } f2({ file: '/tmp',
folder: 'foo.txt' }); // easier to see the error
This is especially true when the function is defined elsewhere.