mametur
3/30/2020 - 10:59 AM

javascript

private property oop

let human = {

    name: "mame",
    lastName: "tur",
    _id: 63

};
// "_" this mean the properties is private you should not change it.

Object.defineProperty(human, "_id", {
    enumerable: false,
    value: 63,
    writable: false

});