Paulund

In this tutorial we’re going to change a string of words to be camel-cased.

You can do this by using the below regex to select all the matched parts of the string and then on the first index you lowercase the word and on the next indexes you can make…

--

--

Here is a quick code snippet you can use in your projects to check if an array is empty.

const isNotEmpty = arr => Array.isArray(arr) && arr.length > 0;isNotEmpty([1, 2, 3]); // Result: trueisNotEmpty([]); // Result: false

isNotEmpty

If you like you can create the opposite helper function…

--

--

Here is a quick code snippet I use to capitalize the first letter in a string.

// Capitalize the first letter of a string
const capitalize = (text) => `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
console.log(capitalize("here is some text"));
// Here is some text

This will take the first letter of the string and uppercase…

--

--

When working with APIs in your Javascript application it can be useful to be able to debug the requests and responses you’re using to interact with the API.

Axios comes with a feature called interceptors that allow you to run some code before a request and after a response. This…

--

--