Toggle dark mode How do I copy an object in JavaScript? It’s a simple question, without a simple answer. Chinese translation: 中文版 Russian translation: русском Uzbek translation: O'zbek Call by reference JavaScript passes everything by reference. In case you don’t know what that means, here’s an example: function mutate(obj) { obj.a = true; } const obj = {a: false}; mutate(obj) console.log(obj.a);