Solving Exercism's Resistor Color Duo in TypeScript
Today as a code kata I completed the ‘Resistor Color Duo’ TypeScript exercise on Exercism. Here’s my work. This exercise asks us to write a TypeScript function that takes two color names (e.g. ‘brown’ and ‘black’) and returns the electrical resistance they would produce on a resistor as a number (10 in this example). My Goals I approached this challenge with the following goals: Solve the problem Learn TypeScript better Leverage implicit typing Here’s the spec and my solution. ...