Skip to main content

5 posts tagged with "javascript"

javascript articles

View All Tags

The URL Object

· 4 min read
Aaron wolf
Lead writer and developer
note

This blog post was originally posted on dev.to

Overview

The URL object in JavaScript provides a way to work with and manipulate URLs easily. It’s particularly useful when you need to construct, parse, or modify URLs within your code.

async/await

· 2 min read
Aaron wolf
Lead writer and developer
note

This blog post was originally published on dev.to

async / await is a newer way of writing asynchronous code compared to promises. The main advantages of async/await are improved readability and the avoidance of promise chaining. Promises can become long, hard to read, and may contain deeply nested callbacks that can be difficult to debug.

Promises and fetch

· 3 min read
Aaron wolf
Lead writer and developer
note

This blog post was originally published on dev.to

Restaurants

A promise in JavaScript is just a pending task. It’s like ordering food at a restaurant: when you place your order, the server makes a promise to bring the food you ordered. Once the food is brought to the table the promise has been fulfilled. If the food you ordered can’t be served because the kitchen is out of a key ingredient, then you can catch a meal somewhere else.

Temporal Date API

· 6 min read
Aaron wolf
Lead writer and developer
note

This blog post was originally published on dev.to

We all know that dates in JavaScript suck. Temporal is the API that we will come to succeed the legacy date API in JavaScript. This post is about my experience with the new Temporal API.

At the moment (no pun intended), Temporal is still in stage 3 (out of 4) of development. This means that it should not be used in development, but if you're curious on how to use it you can still use the Temporal polyfill.

Drag and drop from scratch with React

· 5 min read
Aaron wolf
Lead writer and developer

Intro

In this tutorial I will show how to make a Drag and Drop component from scratch with no 3rd party libraries using React.

Important info

  1. There exists the event handler e.dataTransfer which helps with drag and drop functionality, but as we're using React I find using state to be simpler.

  2. Make sure to check out the Code Sandbox. I may add a few things that aren't reflected below, but the code below is complete.

  3. You might know a better way to do this! If you think you can improve the code please comment.