TypeScript

A collection of 15 posts

Exercises

CodeWars - Catching Car Mileage Numbers

Problem You need to identify “interesting” numbers. When the number is interesting return 2, if it is “near” an interesting number return…

  • HappyNeal
Exercises

CodeWars - Unlucky Days

Problem The question is basically count the number of instances of Friday the 13th in a given year. Original Problem: https://www.codewars…

TypeScript

Better Function Signatures with the Destructuring Assignment

When writing a function sometimes you cannot avoid passing multiple arguments into the function. Lets take a look what is the cleanest way…

TypeScript

Case Study - Add Function - Writing Tests

Assuming we have a function . How can we ensure that the function is doing that what we expect it to do. Expected Result Tests The first and…

TypeScript

Case Study - Add Function in JS vs TS

We are going to take a look at how to implement the “add-numbers” function. The purpose of the “add”-function is to add two numbers, it…

TypeScript

Hello World - A full Tutorial

When you start programming, probably one of the first things you will learn is how to output “Hello World!“. The program is simple to write…

  • HappyNeal
TypeScript

VSCode TypeScript debugging

The VS Code debugger is pretty awesome. You can learn more about it in the official guide. If you want to debug typescript it does not work…

VSCode

Code Metrics - A red flag for overly complex code

When you are writing code your main focus should be solving the problem at hand - creating code that works. However this is only a very…

TypeScript

Setting up TypeScript and Jest

We will take a quick look at how to set up a project using TypeScript and Jest. By adding Jest to the project from the beginning this should…

TypeScript

Getting started with MOBX 5 and TypeScript 3, React 16.6

When looking around for example applications that use Mobx 5.x combined with Mobx-react 5.x and TypeScript 3.x I did not find any useful…

Code

Setting up a dev environment to learn TypeScript

TypeScript is basically JavaScript with types. When writing your code you must define the types of your variables and optionally the returns…

Exercises

CodeWars: Weekly Newsletter 02

8kyu - Logic Drills: Traffic light You need a function to handle each change from green, to yellow, to red, and then to green again…

Exercises

CodeWars: Weekly Newsletter

8kyu - positiveSum The first question is to sum up all the positive integers in an array. Basically two things need to be done: Filter out…

Exercises

CodeWars Kata: File Path Operations

The problems in this Kata File-Path-Operations revolve around implementing common filename functions. Functions are needed to find the file…

Exercises

Exercise of the Day: Determine if String Halves Are Alike

Problem: You are given a string s of even length. Split this string into two halves of equal lengths. Two strings are alike if they have the…