summary refs log tree commit diff stats
path: root/javascript/resistor-color/resistor-color.js
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-08-27 09:36:49 +0530
committerAndinus <andinus@nand.sh>2021-08-27 09:36:49 +0530
commit346da9a7e08af19141a791978b3650bb150eafb0 (patch)
treec680fc4c2d30a0f5b35a64acb06f5ed4678a148e /javascript/resistor-color/resistor-color.js
parent16f7aba7ef1b48d940bca66adb59d10527b885e8 (diff)
downloadexercism-346da9a7e08af19141a791978b3650bb150eafb0.tar.gz
JS: Solve resistor-color exercise
Diffstat (limited to 'javascript/resistor-color/resistor-color.js')
-rw-r--r--javascript/resistor-color/resistor-color.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/javascript/resistor-color/resistor-color.js b/javascript/resistor-color/resistor-color.js
new file mode 100644
index 0000000..735ca5d
--- /dev/null
+++ b/javascript/resistor-color/resistor-color.js
@@ -0,0 +1,6 @@
+export const colorCode = color => COLORS.indexOf(color);
+
+export const COLORS = [
+    "black", "brown", "red", "orange", "yellow", "green", "blue",
+    "violet", "grey", "white",
+];