specify typescript for generic function like Math

后端 未结 0 866
温柔的废话
温柔的废话 2021-01-11 17:33

I have this code in TS

const arr = ["123.2", "abc", "78.3"];
console.log(arr.map((v) => (!isNaN(v) ? Math.floor(v) : v)));


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题