var task = {};
task.prop1 = "prop1 value";
task.prop2 = "prop2 value";
console.log(task);
var newTask = Object.create(task);
console.log(newTask);
In this case, why is newTask printing empty? As I understand it, shouldn't it print the properties of task?
Edit: I found out that when we create the object through Object.create(task), we are assigning newTask's prototype as task, hence new task does not have the native task object's proprties which can be verified via getOwnProperty() on the newTaskObject. But when we carefully examine, when we try to access the properties of task object through newTask, the prototype chain is rolled up and we dont get undefined. Please correct me if I am wrong.

console.logfor both values print the same object.newTaskis not empty if you check correctly.