jskatas.org Continuously Learn JavaScript. Your Way.

Latest Posts

I was surprised to see that the worker threads run in non-strict mode by default. This should rarely happen, because when using ES modules (ESMs), classes or "use strict" then the engine forces strict mode. I didn't know this in the beginning. I have been working on the katas I use for this site in the javascript-katas repo which uses ESMs and type=module, my default. This makes the entire nodejs project, any npm ... command run use strict mode. Escaping from strict mode is not easily possible, but one way to run code in non-strict mode is by using a worker thread.

An array is like a queue where you can have zero, one or many values. The first value can be found at index 0, and others follow. An empty array, like a queue with no one in it, is written in JavaScript as []. The [ and ] are the start and end markers, and items inside are separated by commas. For example, to make an array with the numbers 0 to 3, you write [0, 1, 2, 3].

Coming across "unary operators" might happen in JavaScript, or (m)any other programming language(s). A couple examples for what is a "unary operator".
In JavaScript you may find: +1, -42, + "1", !true, delete x. All those are unary operators as you can also read on MDN and in the spec. But what does the "unary" really mean? And why is 1 + 1 not using a unary operator?

I had planned building the kata for Number.parseInt() already a while ago. Starting to work I discovered very quickly that this seemingly tiny kata is quite a rabbit hole that offers a lot of things one can learn. Especially about how things evolve in the spec and how to read the spec, fortunately this is a pretty easy to read part of the spec.

This article explains the vision of jskatas.org.
In short it is:
Continuously Learn JavaScript. Your Way.