Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
YouTube Security VideosNutanix advances legacy and AI app management with AMD(01.10.2026 um 16:00 Uhr)
•
YouTube Security VideosPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••••
Videos & KonferenzenPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••
Sicherheitslücken (CVE)USN-8857-1: KCoreAddons vulnerability(01.10.2026 um 12:48 Uhr)
•••
YouTube Security VideosNutanix advances legacy and AI app management with AMD(01.10.2026 um 16:00 Uhr)
•
YouTube Security VideosPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••••
Videos & KonferenzenPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••
Sicherheitslücken (CVE)USN-8857-1: KCoreAddons vulnerability(01.10.2026 um 12:48 Uhr)
•••
Intelligence View
⚡ tsecurity.de Intelligence

const with Object or Array in Javascript

Intro When you use const to declare objects or arrays in JavaScript, you’re making the variable binding (the reference) immutable — not the contents the…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!




Intro



When you use const to declare objects or arrays in JavaScript, you’re making the variable binding (the reference) immutable — not the contents themselves.



This means you cannot assign a new array or object to that variable, but you can still change the data inside the object or array.



For example:



const c = [1, 2]; // c is bound to a specific array



If you try to reassign c to a new array:



c = [3, 4]; // This will cause an error: Assignment to constant variable



The error occurs because const prevents changing what c points to.



However, you can modify the elements within the array:



c[0] = 5; // Allowed: changes the value at index 0

console.log(c); // Output: [5, 2]



This works because const only protects the binding (the reference to the array), not the array’s contents.






Summary



Declaring an array or object with const means the variable must always point to the same array or object. However, you are free to update, add, or remove items within that array or object. The reference stays constant, but the internal data can change.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten const with Object or Array in Javascript

Thematisch verwandte Begriffe: const, with, Object, Array · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag