fix(curriculum): test that contacts array is not modified in lab profile lookup (#65032)

Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
This commit is contained in:
Anna
2026-01-11 23:53:12 -05:00
committed by GitHub
parent 112f46f20e
commit 12940f4905
@@ -24,7 +24,7 @@ For this example imagine there is a contact named Akira Laine, the `lookUpProfil
# --before-each--
```js
contacts = [
const _contacts = [
{
firstName: "Akira",
lastName: "Laine",
@@ -50,6 +50,8 @@ contacts = [
likes: ["JavaScript", "Gaming", "Foxes"],
},
];
contacts = structuredClone(_contacts);
```
# --hints--
@@ -111,6 +113,13 @@ assert.strictEqual(lookUpProfile('Bob', 'potato'), 'No such contact');
assert.strictEqual(lookUpProfile('Akira', 'address'), 'No such property');
```
The `contacts` array should remain unchanged after running `lookUpProfile`
```js
lookUpProfile("Sherlock", "likes");
assert.deepEqual(contacts,_contacts);
```
# --seed--
## --seed-contents--