Sobes.tech
Junior — Senior

Determining the output of console.log in a JavaScript fragment

livecode

Task condition

Specify which values will be printed by the console.log function in the given code.

let firstObj = { greeting: 'hey' };
let secondObj = firstObj;
firstObj.greeting = 'ho';
console.log(secondObj.greeting);
firstObj = { greeting: 'hello' };
console.log(secondObj.greeting);