Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5e7fb2

Browse files
committed
Added section on keywords
1 parent fc76134 commit b5e7fb2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fundamentals/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,13 @@ now it is an expression. This is an exceptional situation where something can be
256256

257257
The following are not expressions:
258258

259-
* `var` -> this is nothing
259+
* `var` -> this is a keyword, see below
260260
* `var x;` -> this is a statement
261261
* `+` -> this is only an operator
262262
* `if (a > 4) { return "yes"; } else { return "no"; }`
263263

264-
`if` is also a statement. However, it is quite a complex statement. It is also referred to as a "construct", just like `for`, `while`, `try`, etc.
264+
`if` is also a statement. However, it is quite a complex statement. It is also referred to as a "construct", just like `for`, `while`, `try`, etc.
265+
266+
### Keywords
267+
268+
Some words in JavaScript are special, e.g. `var`, `if`, `while`, `return`. These are called "keywords". You typically cannot use these words as names for your variables, functions.

0 commit comments

Comments
 (0)