I have a simple task here that requires me not to make the id enumerable but at the same time, it should be shown when logging the object in the console how can I achieve that when I have to make the property descriptor enumerable false?
const myObj = {
username: "Elzero",
id: 100,
score: 1000,
country: "Egypt",
};
// Write Your Code Here
Object.defineProperty(myObj, 'id', {enumerable: false});
for (let prop in myObj) {
console.log(`${prop} => ${myObj[prop]}`);
}
console.log(myObj);
// Needed Output
// "username => Elzero"
// "score => 1000"
// {username: 'Elzero', score: 1000, id: 100}