我有问题,当在TypeScript中使用命名参数时,我知道它不支持我在TS中使用它的方式.但我怎么能
打字稿:
SomeFunction(name1: boolean, name2: boolean, name3: boolean, name4: boolean) //will occur only 1 time, so the change should be in typescript
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
$(function () {
...SomeFunction({name1:false, name2:false, name3:false, name4:true}); //will occur 100 times
});
Run Code Online (Sandbox Code Playgroud)
我在看(这没有用):
我可以在TypeScript中做什么,在JavaScript中使用命名参数?
我想知道的是,当我在TypeScript中使用它时,VS2015在使用命名参数时没有显示语法错误...
ps.:我使用TS 2.1
这是按预期工作的:
这parseFloat(newValue).toLocaleString("de-DE", { minimumFractionDigits: 2, maximumFractionDigits: 2 })将产生一个字符串:"34.886,55"
这不会按预期工作:
因为parseFloat("34.886,55") 我得到了一个数字,但我失去了逗号后的所有内容:34.886。
我该如何解决这个问题?