i am getting a strange javascript array behaviour when im pushing a value inside an array which resides in an object. the array in initially empty and then i push a value into it. now the strange behaviour is that, i console log the obj before and after pushing the value. in the console.log before pushing, the array inside the object should be empty but its giving the array after operation in console log.
let myObj = [{key1: 'hello', key2: []}];
console.log(myObj);
myObj[0].key2.push(1);
console.log(myObj);
both the console logs in the above code give [ { "key1": "hello", "key2": [ 1 ] } ]
How is this possible

[{ key1: "hello", key2: [] }]. Nothing strange about it