JavaScript Tip 💡 Did you know that you can cancel a fetch request using an AbortController? A common use-case is React: If a component unmounts while a fetch call is awaited, it can be useful to abort the call.

JavaScript

JavaScript Tip 💡 Instead of using find(), or manually searching a list for an occurrence, use the array method some() instead. It’s built for exactly that purpose.

JavaScript

JavaScript Tip 💡 Memoization is one of the most used optimization techniques. Check what it is and how it works 👇

JavaScript

💛 JavaScript tip 💛 Did you know that you can use numeric separators to make large numbers more readable? It may sound trivial, but this can save anyone reading your code a lot of time! 👇🏻

JavaScript

JavaScript Tip 💡 Use the property valueAsNumber to get the numeric number from an input field through an event. Here's an example in React 👇

JavaScript

TypeScript Tip 💡 ️Did you know? You can assign field variables inline using TypeScript ✌️

JavaScript

TypeScript Tip 💡 If you cannot infer or define the type, use 'unknown' instead of 'any'. Using 'unknown' forces you to null-check or narrow the type before using it. 'unknown' is the type-safe counterpart of 'any'.

JavaScript

💛 JavaScript tip 💛 You can quickly filter out all falsy values from an array by combining filter with the Boolean constructor function. 👇🏻

JavaScript

💛 JavaScript tip 💛 This is how you calculate the total sum of an array with only one line of code. 👇🏻

JavaScript

You had the following error "function gen_random_uuid() does not exist". Trying to Represent default values ​​that cannot be expressed in @prisma schema(gen_random_uuid()). with @supabase_io Thank you @iwatakeshi

JavaScript

JavaScript Tip 💡 Did you know that JSON.stringify takes a replacer function as its second argument? You can use it to do filter and replace values when stringifying an object.

JavaScript

A lot of times I use @Alpine_JS for simple UI niceties, like fading an element out after a given time, toggling a class on click, etc. Writing all of this x-... code every single time is quite cumbersome, so I created a couple of Blade directives that make this super easy.

Laravel
JavaScript

The tweet will be reviewed and posted as soon as possible

{{ newSnippetForm.errors.url[0] }}

{{ newSnippetForm.errors.categories[0] }}