I went bravely from using js to jsx files. Then I overcame the gag reflex to write html in javascript. It was time to cover the final threshold with TypeScript and the tsx filetype. In this article, I cover briefly, how to use TypeScript with React. Defining types within functions If you’re familiar with TypeScript, […]
Category: Javascript
Sometimes you might want to run a function without ever having to call it. This is especially useful when you want to declare some global variables, but also keep them private, within a function. This article explains how you can immediately call a function in javascript. What is an IIFE? An Immediately Invoked Function Expression […]
Using the native fetch() to get frontend api data with javascript is easier than ever, and works great alongside frameworks such as vue. Grabbing data the old way Before fetch came along, API requests were made using XMLHttpRequest, which didn’t include the use of Promises. It was a little bit verbose, like so: Grabbing data […]
Arrays are the bread and butter of javascript when it comes to handling data. Especially awhen grabbing data from APIs and filtering results. I’ve noted some super useful built in methods relating to arrays, to help with all sorts of situations. Get to know these, for great power comes great responsibility…
I’m always improving my javascript skills when I’m learning something new. Sometimes it’s worth going over existing skills again to reinforce that knowledge. I’ve found these 5 things to be pretty powerful. 1. Underscoring Variables and Namespacing events These is more helpful for code readability, rather than it being a particular feature. The first uses […]