Skip to content

Commit d4ff80c

Browse files
authored
Update article.md
1 parent 38e1bb5 commit d4ff80c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

1-js/02-first-steps/04-variables/article.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,16 @@ const pageLoadTime = /* time taken by a webpage to load */;
285285
The value of `pageLoadTime` is not known prior to the page load, so it's named normally. But it's still a constant because it doesn't change after assignment.
286286
287287
In other words, capital-named constants are only used as aliases for "hard-coded" values.
288+
One more point to remember is you can not just declare a const variable without initializng it at the same line.
289+
For instance the below code will throw error :
290+
```js
291+
const variable;
292+
varibale=100;
293+
```
294+
Correct code is :
295+
```js
296+
const variable=100;
297+
```
288298
289299
## Name things right
290300

0 commit comments

Comments
 (0)