diff --git a/solutions/typescript/resistor-color/1/resistor-color.ts b/solutions/typescript/resistor-color/1/resistor-color.ts new file mode 100644 index 0000000..d8fd28e --- /dev/null +++ b/solutions/typescript/resistor-color/1/resistor-color.ts @@ -0,0 +1,14 @@ +export const colorCode = (color: string): number => { + return COLORS.indexOf(color); +} + +export const COLORS = ["black", + "brown", + "red", + "orange", + "yellow", + "green", + "blue", + "violet", + "grey", + "white"]