Image for post
Image for post
Photo by Diego PH on Unsplash

Perhaps I’ve been living under a rock, but for this task, I’ve used parseInt and parseFloat and never second-guessed my approach, what else could there be? Turns out there is a shorthand I could have used most of the time that is 10 times shorter!

I’m talking about parseFlaot that ends up being just a single character, that operator is called the Unary Operator or just a + symbol.

const s = "10";
const n = +s;
console.log(typeof n); // "number"

It can be used in expressions as well, though it does look a tad odd in that environment.


Image for post
Image for post
Photo by an_vision on Unsplash

While our website was a simpleReact application there were no client-side logs, just API logs, and the trusty Network tab of the Chromes dev-tools. This was enough for debugging and fixing issues.

Then came a day when SEO became important, the simple React application had to implement SSR (Server Side Rendering), a NodeJS process became involved.

It turned out great — the website loads a lot faster and is crawlable, but it did complicate the debugging process. …

Image for post
Image for post
Photo by Alex Knight on Unsplash

On the 22nd November of 2020, LTT released a video about a Colorful RTX 3080, which they later were going to “give away”. It is in quotes because, in reality, they were going to sell it for one dollar in the next 24 hours. A nice and neat idea.

Linus did, however, say that bots won’t help because the page does not yet exist. This got me thinking — is that really true? If it were that simple then scalping would not be a problem.

The challenge

From the scarce information given it, all boils down to that their merch shop will…

Image for post
Image for post
Photo by Mohdammed Ali on Unsplash

If you do a google search for the term javascript operators and click on the first result— this mystical operator will be nowhere to be seen. At least in September of 2020, you have to click on the fourth result and then do a search on the page for it, otherwise, it is really easy to overlook it as it is not included in any of the pretty tables.

Enough secrets!

I’m talking about the Nullish Coalescing Operator?? , it is a binary logical operator, the same as || (logical OR)and && (logical AND) except that it does not do…

Image for post
Image for post
Photo by Andrew Ridley on Unsplash

Everyone has probably heard about them by now, though many have been probably been scared off by hearing the words “CSS in JS”. I wouldn’t blame them, I was very pessimistic when I first heard that word combination.

If placing css in the HTML is considered bad practice, why would putting it in js be any better, right? …

Image for post
Image for post
Photo by Markus Winkler on Unsplash


Have you ever been exited and filled to the brim with motivation to do a certain task only to find your self slowly becoming less and less productive?

Why using just React’s state mechanism is a bad idea

Image for post
Image for post
Photo by Guillaume Bolduc on Unsplash


Now that we have hooks and the Context API , it may seem appealing to forgo a state management library when starting a new project in React — should we give in to the temptation? Let’s find out by looking at a simple shopping cart example, starting at the bottom of the tree — item list view.

At the bottom

A context consumer component would look something like this, granted, this is quite a simple example, but it illustrates the main points of interest well. It simply renders a list of items, which can be added or removed from the cart.

const SimpleItemList…

How does state management differ between Redux and MobX in a React app?

Image for post
Image for post
Photo by Greg Rosenke on Unsplash


A JavaScript library for building user interfaces

This is the sub-title from the React landing page, which subtly expresses its main concern — rendering components in an efficient manner, this is also emphasized if you do a bit more reading on their main page.

Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.

For the developer, it means that the framework does not provide a de facto way of managing an application state, only a local component state. This can be a blessing or a…

The core reasons for why you should always use TypeScript instead of JavaScript

Image for post
Image for post
Photo by John Barkiple on Unsplash


As developers, we strive to write the best code we possibly can, at the same time the term “good code” is not completely objective, only to a certain point, after which it does become quite subjective with personal preferences.

There are quite a few principles, which when followed and not abused, lead to good code, a few of them would be:

  • KISS — “keep it simple, stupid” Don’t be overly clever, doing something in fewer lines does not make it better, on the contrary, it may hurt the next person trying to figure out what is going on and how…

Image for post
Image for post
Photo by Nick Fewings on Unsplash

A step back

Writing functions is a simple, yet very powerful way of encapsulating reusable logic, it is very important in mastering writing truly beautiful code.

There are quite a lot of ways of writing functions in Javascript — should we mix them in a single codebase or stick to one specific style? There is only one way to find out, by going through all of the approaches.

Function declarations

The most straightforward of the bunch, but it has a dirty little secret.

console.log(powerOfTwo(2)); // outputs 4function powerOfTwo(num){
return num * num;

They are hoisted just the same way as variables declared with…


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store