最佳答案
有人知道TypeScript中String和string的区别吗?我假设它们应该是一样的,对吗?
var a: String = "test";
var b: string = "another test";
a = b;
b = a; // this gives a compiler error!
当前版本的编译器说:
Type 'String' is not assignable to type 'string'.
'string' is a primitive, but 'String' is a wrapper object.
Prefer using 'string' when possible.
那是虫子吗?