How arrays and objects are copied in JavaScript?