Currently, I'm receiving a value from an input field and assigning it to the name of a property within an object. However, I'm running into an issue when trying to delete this property.
function addPr() {
let propName = prop.value;
employees = Object.create(Object.prototype, {
[propName]: {
value: val.value
},
});
console.log(employees);
del.addEventListener("click", () => {
delete employees[propName];
console.log(employees);
});
}