当前位置 : 主页 > 网络编程 > JavaScript >

defineGetter

来源:互联网 收集:自由互联 发布时间:2021-06-30
defineGetter // https://github.com/expressjs/express/blob/master/lib/request.jsfunction defineGetter(obj, name getter) { Object.defineProperty(obj, name, { configurable: true, enumerable: true, get: getter })}
defineGetter
// https://github.com/expressjs/express/blob/master/lib/request.js
function defineGetter(obj, name getter) {
    Object.defineProperty(obj, name, {
        configurable: true,
        enumerable: true,
        get: getter
    })
}
网友评论