You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
````warn header="Declaring twice triggers an error"
138
+
A variable should be declared only once.
139
+
140
+
A repeated declaration of the same variable is an error:
141
+
142
+
```js run
143
+
let message = "This";
144
+
145
+
// repeated 'let' leads to an error
146
+
let message = "That"; // SyntaxError: 'message' has already been declared
147
+
```
148
+
So, we declare a variable once, and then should refer to it without `let`.
149
+
````
150
+
151
151
```smart header="Functional languages"
152
152
It's interesting to note that there exist [functional](https://en.wikipedia.org/wiki/Functional_programming) programming languages, like [Scala](http://www.scala-lang.org/) or [Erlang](http://www.erlang.org/) that forbid changing variable values.
0 commit comments