Same object or same content

A copied booking can have the same details as the original.

your task

For “selection kept”, check whether selected and picked are the same object. For “server copy matches”, check the room and hours. Print the two results in that order.

The desk should keep the booking object the user selected. The server always returns a separate object. The starter accepts a copied selection and rejects server data that matches.

Starter code
or press Ctrl EnterNot run yet

cases

Not run yetOriginal selection, matching server data

Expected output

1selection kept: true
2server copy matches: true
See the input and the code for this case
function sameContent(a, b) {
  return a.room === b.room && a.hours === b.hours;
}
const picked = { room: "Atlas", hours: 2 };
const selected = picked;
const fromServer = { room: "Atlas", hours: 2 };
Not run yetCopied selection, different server hours

Expected output

1selection kept: false
2server copy matches: false
See the input and the code for this case
function sameContent(a, b) {
  return a.room === b.room && a.hours === b.hours;
}
const picked = { room: "Atlas", hours: 2 };
const selected = { room: "Atlas", hours: 2 };
const fromServer = { room: "Atlas", hours: 3 };