Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 399 Bytes

restrict-plus-operands.md

File metadata and controls

30 lines (23 loc) · 399 Bytes
sidebarDepth categories tags
0
TypeScript
TSLint
TypeScript

restrict-plus-operands

使用 + 运算符的时候,前后变量的类型必须一样。

const foo = '5.5' + 10;
const foo = 1n + 1;
const foo = '5.5' + String(10);
const foo = 1n + 1n;