in reply to Re^5: Shouldn't references be readonly?
in thread Shouldn't LITERAL references be readonly? (updated)
They are all literal reference constructors the content is mutable.
Please compare the analogue situation in JS where [] and {} explicitly documented as "literal".°
See also Readonly which makes the explicit distinction about overwriting a variable holding an array and protecting the deep content.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
UPDATE
°)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Array
Arrays can be created using the literal notation: let fruits = ['Apple', 'Banana']; console.log(fruits.length); // 2 console.log(fruits[0]); // "Apple"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Shouldn't references be readonly? (updated)
by dave_the_m (Monsignor) on Aug 05, 2020 at 21:20 UTC | |
by LanX (Saint) on Aug 05, 2020 at 21:41 UTC | |
by LanX (Saint) on Aug 05, 2020 at 21:35 UTC | |
by dave_the_m (Monsignor) on Aug 06, 2020 at 08:51 UTC | |
by LanX (Saint) on Aug 06, 2020 at 12:26 UTC | |
by chromatic (Archbishop) on Aug 06, 2020 at 00:41 UTC | |
by LanX (Saint) on Aug 06, 2020 at 01:35 UTC | |
by chromatic (Archbishop) on Aug 06, 2020 at 05:26 UTC | |
|
In Section
Seekers of Perl Wisdom