Reference vs Copy
Try reference, shallow copy, and deep copy to see which changes ripple through to the other side and which stay separate.
Ready to remix β hit the π΄ Remix button below. You'll sign up first, then this app is copied into your workspace.
Make this app your own
Creates a private copy. Review and send your request in the playground to start AI editing.
About this app
Reference vs Copy is an interactive JavaScript learning app that demonstrates how primitive values, object references, shallow copies, and deep copies behave. Use guided buttons and visual box-and-label examples to change values or colors and see immediately whether the original and copy change together. Step-by-step goals and feedback reinforce why shared references behave differently from independent copies.
Use cases
- Beginners learning JavaScript variables and objects
- Students studying reference semantics and copying
- Teachers demonstrating shallow versus deep copy
- Learners practicing through interactive coding exercises
Features
- Interactive examples for value copying with numbers and text
- Reference exercises using two labels connected to one box
- Shallow-copy demonstrations that share inner objects
- Deep-copy demonstrations with independent outer and inner data
- Guided goals, run, reset, and next-step controls
- Visual color and pattern changes that reveal shared state
Explore related apps
Derivatives, Maxima and Minima
Slide the tangent line to read the sign of the slope, locate maxima and minima where it changes, and find the largest fenced area for a fixed perimeter.
Angles, Ratios and Patterns
Turn the protractor to measure angles, simplify ratios into percentages, and work out the next number in a pattern.
Coordinate Plane & Proportions
Read coordinates and quadrants, then change the values to see direct proportion draw a line and inverse proportion a curve.
Linear Inequalities & Number Lines
Solve linear inequalities step by step and mark the solution set on a number line (β/β), seeing how dividing by a negative flips the inequality sign.