💡Inform user that connection is restored and he/she can continue his/hers work. 👍 Excellent for user experience if he/she is trying to save something to your application and connection is beign terminated. #js #100DaysOfCode #freeCodeCamp #javascript #CodeNewbie

JavaScript

🔥 Laravel Tip #79: To avoid render blocking JS, consider using async or defer attributes. Use async for independent scripts that require early loading (e.g. analytics). Use defer for scripts that need the DOM or need to execute in order. Learn more:

JavaScript

TypeScript Tip 💡 You can use "Pick" to quickly create new types. And the cool thing is... Pick is an inbuilt utility type. We have that available natively in TypeScript.

JavaScript

Need to grab the second item from an array? Here are two (of many) ways to do that with destructuring! Since arrays are objects, you can use the index as a property to destructure it

JavaScript

Tiny little snippet - powered by @Alpine_JS - that lets you quickly convert timestamp into the browser-local representation.

JavaScript

More and more I’m thinking that your app (and database) should always be configured for UTC. - Convert dates to local using JavaScript in the browser for web users. - Use the `timezone()` method for scheduling tasks “Everything is in my timezone” until it isn’t

Laravel
PHP
JavaScript

⚡ Promise.allSettled With this new member of Promise, we can accept an array of Promises and only resolve when all of them are settled. Either resolved or rejected. This enables us to run all promises without caring if they're resolved or rejected.

JavaScript

⚡ globalThis If you want to reuse code across different runtimes, you'll run into trouble with the global object. globalThis will reference 'window' in browsers, 'global' in Node.js, and 'self' in Web Workers. Now we don't have to manually detect the runtime anymore.

JavaScript

JavaScript Tip 💡 3 ways to fill an array using JavaScript. Which one do you use most often?

JavaScript

JavaScript tip: Use the `Fullscreen API` to open any element in full-screen mode.

JavaScript

💙 TypeScript tip 💙 You can tie the return type of a function to specific values provided as arguments. The keyof operator allows you to extract the keys of interfaces, objects, and more and use them to create generic types!

JavaScript

💡 JavaScript Tip 3 Cool ways to create an array filled with ascending numbers 👇

JavaScript

The tweet will be reviewed and posted as soon as possible

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

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