Open
Description
As a JavaScript developer, I expect to see arrays and objects like primitive value, rather than ones that are completely not writable.
I expect modifying a partial value in tuple/record should update the whole value of tuple/record.
const foo = #[1, 2, 3];
let bar = foo;
console.log(foo === bar); // true
bar[1] = 5; // It's `let` binding. I think this is OK
console.log(foo === bar); // false
bar[1] = 2; // change back
console.log(foo === bar); // true
foo[1] = 5; // expect runtime error, foo is `const` binding!!!
/* It' similar to primitive value */
/* Think the above code as following */
const a = 1;
let b = a;
console.log(a === b); // true
b = 5;
console.log(a === b); // false
b = 1;
console.log(a === b); // true
a = 5; // runtime error!!!
Metadata
Metadata
Assignees
Labels
No labels