I have problems when using named parameters in TypeScript. I know it is not supported the way I use it in TypeScript.
But how can I do it?
TypeScript:
SomeFunction(name1: boolean, name2: boolean, name3: boolean, name4: boolean) // Will occur only one time, so the change should be in TypeScript
JavaScript:
$(function () {
...SomeFunction({name1:false, name2:false, name3:false, name4:true}); // Will occur 100 times
});
I was looking at (this did not work out):
Is there a way to provide named parameters in a function call in JavaScript?
How can I add optional named parameters to a TypeScript function parameter?
What can I do in TypeScript, to use named parameters in JavaScript?
What I wonder is, that Visual Studio 2015 did not show a syntax error when using named parameter the way I used it in TypeScript...
PS.: I use TypeScript 2.1