teapawtteapawt
$
  • Timeline
  • Grid
  • Gallery
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 2
Still seeing PRs where people run a whole .filter() and check .length > 0 just to see if an item exists in an array. Pick the right built-in method for what you actually need back so you aren't iterating through the entire list for no reason.
A dark mode JavaScript visual cheat sheet titled Array Search Cheat Sheet by @JavaScriptHubz. It compares four array search methods and their return values: includes(x) returns Boolean (value), some(fn) returns Boolean (test), every(fn) returns Boolean (all), and find(fn) returns First Item.

ALT A dark mode JavaScript visual cheat sheet titled Array Search Cheat Sheet by @JavaScriptHubz. It compares four array search methods and their return values: includes(x) returns Boolean (value), some(fn) returns Boolean (test), every(fn) returns Boolean (all), and find(fn) returns First Item.

1
54
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 2
Plain JavaScript objects are great until you start deleting properties dynamic or need non-string keys. Maps are literally built for frequent write/delete operations and come with an O(1) size lookup. Stop treating them as interchangeable.
A side-by-side comparison infographic titled Object versus Map from @JavaScriptHubz. The left side has a dark background listing Object characteristics: String keys only, No native size, and Slower deletes. The right side has a yellow background listing Map characteristics: Any key type, .size property, and Fast frequent updates.

ALT A side-by-side comparison infographic titled Object versus Map from @JavaScriptHubz. The left side has a dark background listing Object characteristics: String keys only, No native size, and Slower deletes. The right side has a yellow background listing Map characteristics: Any key type, .size property, and Fast frequent updates.

2
113
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 2
JavaScript is single-threaded, but the event loop makes it feel concurrent. When a Promise resolves at the exact same time a setTimeout triggers, the runtime doesn't flip a coin. It has a strict hierarchy.
A diagnostic diagram titled "JS Event Loop Priority". A central glowing circle is labeled "Event Loop". A green horizontal box labeled "1. Microtasks (Promise)" has green arrows pointing down into the loop. A red horizontal box labeled "2. Macrotasks (setTimeout)" has a red arrow pointing to the outer edge of the loop. Watermark @JavaScriptHubz is present.

ALT A diagnostic diagram titled "JS Event Loop Priority". A central glowing circle is labeled "Event Loop". A green horizontal box labeled "1. Microtasks (Promise)" has green arrows pointing down into the loop. A red horizontal box labeled "2. Macrotasks (setTimeout)" has a red arrow pointing to the outer edge of the loop. Watermark @JavaScriptHubz is present.

1
80
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 1
Junior devs think both variables will output 10. Mid-level devs know why they don't. JavaScript evaluates the number 0 differently depending on which operator you throw at it. Drop your answer below.
A dark mode code editor image with a Mac window layout titled "What's the Output?". Line 1: const count = 0; Line 2: const a = count || 10; Line 3: const b = count ?? 10; Line 4: console.log(a, b); The text is color-coded with variables in blue and operators in red. Watermark @JavaScriptHubz is at the bottom right.

ALT A dark mode code editor image with a Mac window layout titled "What's the Output?". Line 1: const count = 0; Line 2: const a = count || 10; Line 3: const b = count ?? 10; Line 4: console.log(a, b); The text is color-coded with variables in blue and operators in red. Watermark @JavaScriptHubz is at the bottom right.

1
44
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 1
Stop mutating your arrays in place and causing weird side effects down the line. Modern JavaScript gives us clean, immutable alternatives that return a fresh array copy without touching the original state. Bookmark this sheet.
A cheat sheet titled "Immutable Array Cheat Sheet" showing modern array methods. It maps old mutating methods on the left in red to new immutable methods on the right in green: sort() to toSorted(), reverse() to toReversed(), splice() to toSpliced(), and index assignment arr[i] = x to with(i, x). Watermark @JavaScriptHubz at the bottom.

ALT A cheat sheet titled "Immutable Array Cheat Sheet" showing modern array methods. It maps old mutating methods on the left in red to new immutable methods on the right in green: sort() to toSorted(), reverse() to toReversed(), splice() to toSpliced(), and index assignment arr[i] = x to with(i, x). Watermark @JavaScriptHubz at the bottom.

1
48
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 1
Calling hasOwnProperty directly on an object is a ticking time bomb. If your object comes from Object.create(null) or someone names a property "hasOwnProperty", your production code crashes instantly. Switch to Object.hasOwn and sleep better.
A dark mode comparison infographic titled "Don't Do This vs Do This" from @JavaScriptHubz. The top section is outlined in red with a cross icon, displaying the code "user.hasOwnProperty('id');". The bottom section is outlined in green with a checkmark icon, displaying the modern alternative "Object.hasOwn(user, 'id');".

ALT A dark mode comparison infographic titled "Don't Do This vs Do This" from @JavaScriptHubz. The top section is outlined in red with a cross icon, displaying the code "user.hasOwnProperty('id');". The bottom section is outlined in green with a checkmark icon, displaying the modern alternative "Object.hasOwn(user, 'id');".

1
45
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 1
Using "delete obj.key" is one of the easiest ways to kill your app's performance in production. The V8 engine hates it because it destroys the hidden class shape. Setting it to undefined keeps the inline cache hot.
An architectural diagram titled "V8 Engine: Hidden Classes" on a dark background. It compares two approaches. The top section is boxed in green: "obj.x = undefined" points to "Fast Inline Cache" with a green checkmark. The bottom section is boxed in red: "delete obj.x" points to "De-optimized Slow Lookup" with a red X. Watermark @JavaScriptHubz at the bottom.

ALT An architectural diagram titled "V8 Engine: Hidden Classes" on a dark background. It compares two approaches. The top section is boxed in green: "obj.x = undefined" points to "Fast Inline Cache" with a green checkmark. The bottom section is boxed in red: "delete obj.x" points to "De-optimized Slow Lookup" with a red X. Watermark @JavaScriptHubz at the bottom.

1
34
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzNov 1
Most bootcamp grads will guess the answer is 2. Run this in your terminal and you might hate JavaScript a little bit more. Why does this happen?
Image from JavaScript Hub 🚀 (@JavaScriptHubz)
1
49
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzOct 10
Junior devs memorize the surface difference between double and triple equals. True senior engineers understand how V8 engine specs handle implicit type coercion under heavy production workloads. Look at this basic JS snippet—what is the exact sequence of the execution output?
Image from JavaScript Hub 🚀 (@JavaScriptHubz)
3
168
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzOct 10
The 'this' keyword ruins JavaScript tech interviews. Master these 3 rules to save your production scope: - Regular: global object - Method: object itself - Arrow: surrounding scope Bookmark this.
Image from JavaScript Hub 🚀 (@JavaScriptHubz)
1
7
159
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzOct 9
Juniors look at this and only see a basic math problem resulting in 90. But platform engineers see a dangerous object mutation anti-pattern that silently de-optimizes V8 engine's Hidden Classes under the hood. What exactly gets printed to the console?
Image from JavaScript Hub 🚀 (@JavaScriptHubz)
1
1
3
139
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzOct 9
The rigid division between frontend and backend is an outdated artifact of legacy engineering teams. In modern system architecture, deep isolation creates massive integration bottlenecks. Developers must evolve beyond isolated silos.
Image from JavaScript Hub 🚀 (@JavaScriptHubz)
40
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzOct 8
Most developers only use VS Code as a basic text editor, missing out on massive productivity extensions. Mastering workspace configuration, multi-cursor refactoring, and keyboard shortcuts completely transforms your engineering velocity. Save this setup reference guide.
Image from JavaScript Hub 🚀 (@JavaScriptHubz)
1
1
166
JavaScript Hub 🚀 (@JavaScriptHubz) profile picture
JavaScript Hub 🚀@JavaScriptHubzOct 7
Mastering JavaScript Objects in one cheat sheet! 🚀💻 Everything you need to know about Object Structure, Accessing Properties, and Destructuring in a single visual guide. 🧠⚡ Bookmark this for your next project! 📌👇 #JavaScript
Image from JavaScript Hub 🚀 (@JavaScriptHubz)
2
1
6
259
Load more