× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Object.assign does a shallow copy!

May 31, 2016
<pre><code class="language-javascript">let a = { x: 1 }; let b = Object.assign({},a); console.log(b.x === a.x);//true</code></pre> <p>Use Object.assign as judiciously as possible, because , there are scenarios where you are checking for a property change and you might not detect it!</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus