The get in defineProperty in js is the same as the get in front of the method, right?

let obj1 = {}

Object.defineProperty(obj1,"name",{
    configurable:true,
    enumerable:true,
    get(){
        return "xxx"
    },
    set(val){

    }
})
getget
let obj2 = {
    get name(){
        return "xxx"
    },
    set name(val){

    }
}

Jun.08,2021

that's right, pretty much.

one is es5 syntax, the other is es6

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eadb9a-217a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eadb9a-217a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?