在JavaScript中,可以通过两种方式定义getter和setter. 通过对象字面量定义,或在ES6的class中定义。 通过使用内置的Object.defineProperty方法。
確定! 回上一頁