Constants declared with const

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Search for a command to run...

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Hoisting refers to JavaScript giving higher precedence to the declaration of variables, classes, and functions during a program’s execution. It makes the computer process declarations before any other code.However, it's important to note that hoistin...
The git log command is used to view the commit history of a Git repository. You can customize the output format to show specific details in a more readable or structured way. Below are some useful variations and formatting options for git log: To sh...

Overview This article will teach us how to: Install Ubuntu Server 24.04 on a laptop from scratch Install Ubuntu server by using Vagrant tool with ISO image Prerequisites: A laptop without any OS installed; A virtualization software Virtualbox t...

The /etc/passwd and /etc/shadow files are the backbone of Linux user management. Together, they store user account information and handle authentication securely. This article provides a hands-on guide to understanding these files, their structure, a...

In Linux, links are powerful tools that allow you to create references to files and directories. There are two main types of links: hard links and soft links (also known as symbolic links or symlinks). Understanding the differences between these two ...

A hostname is a human-friendly name given to a computer. It is a unique identifier that allows us to identify the machine in various network communications, making it easier to locate and manage devices. Type: hostname To see where it is stored, typ...

A variable declared with const can be mutable or immutable depending on the data type of the assigned value. However, a constant cannot be reassigned to a new value.
The difference between assignment and immutability (mutability) is:
The assignment has to do with variable bindings, binding a name to a piece of data.
Immutability (mutability) is a property that belongs to the actual data that the binding contains. All primitives (strings, numbers, and so on) are immutable, whereas objects are mutable.

To summarize, when we say constants are immutable, we mean that once a primitive value is assigned to a constant, it cannot be changed. And when we say constants are not immutable, we mean that we can change the properties of the non-primitive values like objects, arrays, etc.