Connect toSignal + toObservable for auto-updating API calls!
Check example 👇
No manual subscriptions! Just reactive magic!
Connect toSignal + toObservable for auto-updating API calls!
Check example 👇
No manual subscriptions! Just reactive magic!
Check example and polyfill 👇
Check example and polyfill 👇
Unlike sort(), it does NOT mutate the original array but returns a sorted copy.
Check example 👇
Unlike sort(), it does NOT mutate the original array but returns a sorted copy.
Check example 👇
Replace an array element without mutation.
✅ with() is cleaner and shorter!
Check example 👇
Replace an array element without mutation.
✅ with() is cleaner and shorter!
Check example 👇
Instead of writing:
new Promise(resolve => resolve(myFunction()));
You can use:
Promise.try(myFunction);
✔️ Supports both async and sync functions
✔️ Catching Synchronous Errors
✔️ You can combine async and sync functions
Check examples! 👇
#JavaScript
Instead of writing:
new Promise(resolve => resolve(myFunction()));
You can use:
Promise.try(myFunction);
✔️ Supports both async and sync functions
✔️ Catching Synchronous Errors
✔️ You can combine async and sync functions
Check examples! 👇
#JavaScript
• npm install: 📦 Installs dependencies from package.json, updates package-lock.json if needed. Flexible but slower.
• npm ci: ⚡ Clean, fast install based only on package-lock.json. Reproducible builds, perfect for CI/CD.
💡Tip: In CI? Use npm ci for stability!
#javascript
• npm install: 📦 Installs dependencies from package.json, updates package-lock.json if needed. Flexible but slower.
• npm ci: ⚡ Clean, fast install based only on package-lock.json. Reproducible builds, perfect for CI/CD.
💡Tip: In CI? Use npm ci for stability!
#javascript
Since #ES2023 you can use Object.groupBy() to group array elements based on key!
Check example 👇
Very useful! 🚀 #JavaScript
Since #ES2023 you can use Object.groupBy() to group array elements based on key!
Check example 👇
Very useful! 🚀 #JavaScript
Easier debugging by preserving the original cause of an error.
When you create a new error object (Error), you can pass an additional cause property that specifies what the original cause was.
Check out an example below 👇
Easier debugging by preserving the original cause of an error.
When you create a new error object (Error), you can pass an additional cause property that specifies what the original cause was.
Check out an example below 👇
Need to debug Angular routes?
✅ Use enableTracing (for traditional RouterModule setup)
✅ Use withDebugTracing() (for standalone APIs)
📌 Both log detailed routing events to the console, helping you debug navigation issues in #Angular!
Need to debug Angular routes?
✅ Use enableTracing (for traditional RouterModule setup)
✅ Use withDebugTracing() (for standalone APIs)
📌 Both log detailed routing events to the console, helping you debug navigation issues in #Angular!
NaN stands for “Not-a-Number”, but ironically, it’s of type number! 🤯
You can use Number.isNaN(x) to check if value is truly NaN.
NaN !== NaN (It’s the only value not equal to itself!).
🔥 Why is NaN !== NaN? A JS quirk or a hidden superpower? 🤯
#JavaScript #CodingTips
NaN stands for “Not-a-Number”, but ironically, it’s of type number! 🤯
You can use Number.isNaN(x) to check if value is truly NaN.
NaN !== NaN (It’s the only value not equal to itself!).
🔥 Why is NaN !== NaN? A JS quirk or a hidden superpower? 🤯
#JavaScript #CodingTips
Need to describe that a function returns exactly an empty object {}? Use Record<string, never>!
Why not just {}?
➡️ {} allows adding `any` properties.
➡️ Record<string, never> enforces absolute emptiness. 😎
Perfect for precise type modeling! 🛠️
Need to describe that a function returns exactly an empty object {}? Use Record<string, never>!
Why not just {}?
➡️ {} allows adding `any` properties.
➡️ Record<string, never> enforces absolute emptiness. 😎
Perfect for precise type modeling! 🛠️
Check example! 👇 #JavaScript #CodingTips
Check example! 👇 #JavaScript #CodingTips