Created
October 9, 2017 11:24
-
-
Save JamesTheHacker/f520033953b65b6f64fdf3f617c47c42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change the tweet on our clone | |
shallowClone.tweets[3].tweet = 'Hijacking your tweets bruh!'; | |
// Changed :) | |
console.log(shallowClone.tweets[3]); | |
// Noooooo! Also change! | |
console.log(state.tweets[3]); | |
// Both properties reference the same object | |
console.log(shallowClone.tweets[3] === state.tweets[3]); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment