-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path006-reserved.js
More file actions
64 lines (50 loc) · 1.39 KB
/
006-reserved.js
File metadata and controls
64 lines (50 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// WHAT ARE RESERVED WORDS?
// Examples
// let let = "hello"
// let function = 25
// CATEGORIES OF RESERVED WORDS IN JAVASCRIPT:-
// - Declaration Keywords
// var, let, const,
// function,
// class
// - Control Flow Keywords
// if, else,
// switch, case, default,
// for, while, do,
// break, continue,
// return,
// - Value Keywords
// true, false,
// null,
// undefined,
// Module and Import/Export Keywords
// import, export,
// from, as
// - Other Keywords
// this, new, delete, typeof, void,
// try, catch, finally, throw
// in, of, instanceof,
// with, yield, async, await
// 2. FUTURE RESERVED WORDS:
// Examples: enum, implements, interface, package, private, protected, public, static
// 3. PRACTICAL TIPS.
// 4. BEST PRACTICES.
// let userName = "John"
// let useAge = 35;
// const isLoggedIn = true;
// const calculateTotal = function (){}
// const studentClass = "10th Grade"
// 5. COMMON MISTAKES.
// let return = 10
// let if = true
// let Let = "Hello";
// const Return = 100;
// 6. REAL-WORLD EXAMPLE
// ❌ Trying to use reserved words
// let class = "10th Grade"; // Error!
// let default = "Not Selected"; // Error!
// let new = true; // Error!
// // ✅ Proper naming
// let studentClass = "10th Grade";
// let defaultValue = "Not Selected";
// let isNewStudent = true;