I am learning about new
keywords and have homework
1. I wrote a code to remove a property from the object using the delete operator. So is there any way I don't use delete operator, I still remove it? And using new
keyword?
var student = {
name : "David Rayy",
sclass : "VI",
rollno : 12
};
function updateObj() {
var result = delete student.rollno;
return student;
}
updateObj()
/* expect
var student = {
name : "David Rayy",
sclass : "VI",
};
*/
- Write a function to show all info of student. I haven't done it yet
var student = {
name: 'Herry',
gender: 'male',
age: 18
}
function showInfo(obj) {
}
showInfo();