-
typescript语言,定义一个interface可以有任何属性?
interface Person {
[props:number]:string;
}
const arr:Person = ["number"]
interface Person {
[props:number]:any;
name:string;
}
const obj:Person = {name:"xiaoli",0:"die"}
-
0.1+0.2 为什么不等于 0.3?
- 计算机使用的不是十进制算法,因为二进制
- 可以使用toFixed函数