Repository navigation
Expand file tree
/
Copy pathroadmap.js
More file actions
104 lines (101 loc) · 3.05 KB
/
Copy pathroadmap.js
File metadata and controls
104 lines (101 loc) · 3.05 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
* The Learning Hub - JavaScript 7-stage roadmap, served by GET /api/roadmap
*/
export const JAVASCRIPT_STAGES = [
{
stageNumber: 1,
title: 'Syntax, Types & Operators',
domainFocus:
'Primitive types, memory allocation (stack vs heap), operators, type coercion, control flow, loops',
completed: true,
keyTopics: [
'Stack vs Heap Allocation',
'Type Coercion Rules',
'Nullish Coalescing (??)',
'Optional Chaining (?.)',
],
},
{
stageNumber: 2,
title: 'Functions, Closures, Arrays, Strings & Modules',
domainFocus:
'Lexical environment, execution context stack, hoisting mechanics, closures, currying, this binding',
completed: true,
keyTopics: [
'Lexical Scoping',
'Closure Memory Retention',
'Explicit Binding (call/apply/bind)',
'Arrow Function Lexical this',
],
},
{
stageNumber: 3,
title: 'Objects, Prototypes, Classes & Error Handling',
domainFocus:
'Objects & property descriptors, Maps, Sets, WeakMap/WeakSet, destructuring, spread/rest, Symbols',
completed: true,
keyTopics: [
'Property Descriptors & Object.defineProperty',
'Map vs Object Benchmark',
'WeakMap Garbage Collection',
'Well-Known Symbols',
],
},
{
stageNumber: 4,
title: 'Asynchronous JavaScript & the Event Loop',
domainFocus:
'Event loop execution model, microtask queue vs macrotask queue, Promises, async/await, AbortController',
completed: true,
keyTopics: [
'V8 Microtask Checkpoints',
'Promise State Machine',
'Event Loop Turn Ordering',
'AbortSignal & Cancellation',
],
},
{
stageNumber: 5,
title: 'DOM, Browser APIs, Networking & JSON',
domainFocus:
'Virtual vs real DOM, event bubbling & capturing, delegation, BOM (window, history), Web Workers',
completed: true,
keyTopics: [
'Event Propagation (Capture/Target/Bubble)',
'DOM Reflow vs Repaint',
'Web Workers Offloading',
'IntersectionObserver',
],
},
{
stageNumber: 6,
title: 'Performance, Best Practices & Modern Idioms',
domainFocus:
'Debounce & throttle, memory leak prevention, layout thrashing, hidden classes in V8 JIT (TurboFan)',
completed: true,
keyTopics: [
'Debounce & Throttle High-Order Functions',
'V8 Hidden Classes & Inline Caches',
'Garbage Collection Mark-Sweep',
'Zero-Copy ArrayBuffers',
],
},
{
stageNumber: 7,
title: 'Staff JavaScript Engineer Interview Handbook & Cheatsheet',
domainFocus: 'Interview Q&As, prototype chain deep-dive, algorithmic problem patterns',
completed: true,
keyTopics: [
'Prototypal Inheritance Mechanics',
'V8 TurboFan Deoptimization Triggers',
'Cross-Site Scripting (XSS) Sanitization',
'Memory Profiling',
],
},
];
export function getCompletedCount() {
return JAVASCRIPT_STAGES.filter((s) => s.completed).length;
}
export function getProgressPercentage() {
return Math.round((getCompletedCount() / JAVASCRIPT_STAGES.length) * 100);
}