exotic-classes-falsy-objects

时间:2024-04-27 23:18:32
【文件属性】:

文件名称:exotic-classes-falsy-objects

文件大小:2KB

文件格式:ZIP

更新时间:2024-04-27 23:18:32

JavaScript

类扩展奇异对象 例子 扩展document.all就是JavaScript中唯一的falsy object class No extends Falsy { constructor ( favorite_car = "" ) { super ( ) this . anything = favorite_car } } const about_me = new No ( "USS Enterprice" ) console . log ( Boolean ( about_me ) ) // false console . log ( about_me || "Jet" ) // "Jet" console . log ( typeof about_me ) // "undefined" 扩展arguments对象


【文件预览】:
exotic-classes-falsy-objects-main
----extend-exotic-objects.js(833B)
----README.md(2KB)

网友评论