Engrain by ByteRush

JS.16.01 Mid-levelCore — asked often

deepClone (with cycles, Map, Set, Date, RegExp)

Comes up in: Coding

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • recursion
  • WeakMap for cycles
  • special types
  • preserving prototype (option)
  • symbols as keys
  • comparison with structuredClone

Words you will know

cycle

What you will practise

  • implement with tests

Interview questions this answers

  • Implement deepClone that handles circular references.