i have tried console.table(user); but that does not show value of array in courselist.
i want courseList value similar to other values in one row
var user = {
firstName: "piyush",
lastName: "raj",
role: "admin",
loginCount: 32,
courseList: [],
buyCourse: function (courseName) {
this.courseList.push(courseName);
},
getCourseCount: function () {
return `${this.firstName} is enrolled in total of ${this.courseList.length} courses`;
},
info: function () {
return
},
};
user.buyCourse("react js");
user.buyCourse("angular js");