Number、String、Boolean、Symbol 和 Object

❌ 永远不要使用类型 NumberStringBooleanSymbolObject 这些类型指的是非原始装箱对象,它们几乎从未在 JavaScript 代码中得到适当使用。

Don't ever use the types Number, String, Boolean, Symbol, or Object These types refer to non-primitive boxed objects that are almost never used appropriately in JavaScript code.

/* WRONG */
function reverse(s: String): String;

glS959wJXCKXeO8z/XrUwo5als+TU9tl/pnrr7g0lu4+4mI6fx5gg4c8cHfPgN+p8cOizPCjo/tDewX66g//4HP4msqzr9NSbP0S9HgbY6pubU/dgKJb0gVkJoW2gVjf8sQYEaufYF3eYfEHxwc2/kE30aRaMzwcpzgI5uvLOm1MzyCsdQ6L/q6we4jBZqzuZYYV0QjkmjTRXr1xsfOyES5Ikd1htp6/LHwKVYFC9TFuzn4weOqrg/EVm7MbKeFo/9S1htKHzqzJ2ufxoJKIVKlwjYioeChm0AgU4BnYG5EHN9jaOthuHxbaIQStFZ14nV2WnZiGObGILJ81t1evvyB0031fbTRKJLW+1EDRs3A=

/* OK */
function reverse(s: string): string;

BYlj8TdizpNCS1/+x8jPX0gJYQGno8k13bS3K+EzKg88kChQcIfKPJ54va8TUjZQcd0d9j9uJzyiUYzcwzNBLsYMeLITDwJajnfPUFiew51dVwaMdCu8dWpULX+jjik9qmBf2fLNsktC4MOcaxd6yMyFgEN+7bnQqynheOFAA7BSuDizIblumCVhLoh3JPMj6gq96BfU8x/1W2OmHx/Ce6LWEc7g+DJBZofz5enjdiO7MmEgR7dAUhkt37aCABm/0TK6dYdunRC+SA+X3/KVtfMdsl7IXDD3dslOX87ywXUNH8y/Jy6rc37bYl6PBvklZqa43z/Xb7O2TyQBTOfxjmy8gTOFFuHjB0g/M5fSHwzsfFLtcpM4QZf2UHHskX2zFSA+6mcgxlgnMVWej6POxk2bUctJl/gds2+YEjFuYhfJG5mEIsEp++TQ1YYi8SK/