freeCodeCamp / freeCodeCamp/CurriculumExpansion

Add new lesson for creating/copying objects in JavaScript Objects module

Open
#1,153 2 comments 0 reactions 1 assignee Claimed by @Ksound22 View on GitHub
JS v9 Cert
Dominant language
JavaScript
Stars
340
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Currently, there is no material on creating and/or copying JavaScript objects in the Objects module, with one exception: this [lesson](https://www.freecodecamp.org/learn/javascript-v9/lecture-introduction-to-javascript-objects-and-their-properties/how-can-you-remove-properties-from-an-object) on deleting properties from objects, which briefly shows how to copy an object with excluded properties using the spread operator. While campers could deduce that the same technique works for copying an entire object, they might not fully understand why it works. Furthermore, current coding challenges in the module require creating an object from scratch, and at least [one](https://github.com/freeCodeCamp/freeCodeCamp/issues/64116) incoming lab will require campers to copy and return new objects.

Should we create a new lesson that covers creating objects from scratch as well as copying (spread operator for shallow copies and `structuredClone` for true deep copies)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.