JavaScript Workout

I made a JavaScript workout with a md file in my GitHub repo. Check out the work out here. The idea of this is to list a short JavaScript programming questions that you would encounter every day as a JavaScript developer. If you know how to do these, you don’t need to spend extra time googling the solutions. Well, googling is sometimes fine. But, it will still save you time. There is no difficult questions. Just a basic array manipulation or string formatting. But, they are not super basic either. Something you may forget and need to google the solutions if you haven’t been writing JavaScript for a while.

The entire thing is just a markdown file. There are a lot of things you can do with it as you can actually write a real HTML 5 in there. For example, I utilised a detail tag to make the answer section open and close. Pretty cool.

Try it out and see what you think.

It is still an early stage and we can expand this further. Please contribute to the project if you have good suggestions.

Front-End
TypeScript: type aliases to check type equality

This post is to analyse how the type equality check by using type aliases proposed by Matt Pocock in his twitter post. These type aliases allow us to elegantly express type equality checks in unit tests. All we need to do is to pass the output and expected types in …

Front-End
Fixing it.only type error in Jest

If you are getting a type error with it.only in Jest, it could be due to incorrect TypeScript typings or incompatible versions of Jest and TypeScript. To resolve this issue, you can try the following steps: Make sure you have the latest versions of Jest and its TypeScript typings installed …

Front-End
yup conditional validation example

Here’s an example of a Yup validation logic where the first input field is optional but, if filled, it must contain only alphabetic characters, and the second input field is required: import * as Yup from “yup”; const validationSchema = Yup.object().shape({ firstField: Yup.string().matches(/^[A-Za-z]*$/, { message: “First field must contain only …