JSFiddle - React, Tailwind, and code Playground

by Amanda HUNTER

JavaScript

var joe = {
    name: "Joe",
    age: 32
}

function copy(obj) {
    
Object.getOwnPropertyDescriptor(obj,
'joe');
}
undefined
var jim = copy(joe);
console.group("Test");
if (jim === joe) {
    console.log("Nope! They are the same object")   
} else {
     console.log("Great job! You made a copy.");   
}
console.log("The two objects are:", jim, ",", joe);
console.groupEnd();
VM221:3 Test
VM221:7 Great job! You made a copy.
VM221:9 The two objects are: undefined , Object {name: "Joe", age: 32}