js基础类型的扩展 string 和 String

扩展基础类型的函数javascript interface String { toBool: () => boolean; } String.prototype.toBool = function (): boolean { return this.valueOf() === '1' || this.valueOf().toUpperCase() === 'TRUE' || fal
相关文章
相关标签/搜索