aboutsummaryrefslogtreecommitdiff
path: root/challenge-107
diff options
context:
space:
mode:
authorchirvasitua <stuart-little@users.noreply.github.com>2021-04-11 22:14:40 -0400
committerchirvasitua <stuart-little@users.noreply.github.com>2021-04-11 22:14:40 -0400
commit3e831faee4dc0da0ac273511c38641e0db693497 (patch)
treeb8b285b2e1dd9cb0f8b22f03a8c06fddc51963e1 /challenge-107
parent31bd2a9940939a27a9b2a0a05aae46b4f3b0d95a (diff)
downloadperlweeklychallenge-club-3e831faee4dc0da0ac273511c38641e0db693497.tar.gz
perlweeklychallenge-club-3e831faee4dc0da0ac273511c38641e0db693497.tar.bz2
perlweeklychallenge-club-3e831faee4dc0da0ac273511c38641e0db693497.zip
1st commit on 107_node
Diffstat (limited to 'challenge-107')
-rwxr-xr-xchallenge-107/stuart-little/node/ch-1.js15
-rwxr-xr-xchallenge-107/stuart-little/node/ch-2.js12
2 files changed, 27 insertions, 0 deletions
diff --git a/challenge-107/stuart-little/node/ch-1.js b/challenge-107/stuart-little/node/ch-1.js
new file mode 100755
index 0000000000..24d008c715
--- /dev/null
+++ b/challenge-107/stuart-little/node/ch-1.js
@@ -0,0 +1,15 @@
+#!/usr/bin/env node
+
+// run <script>
+
+const nrs = {
+ 100: [4,1210],
+ 136: [4,2020],
+ 1425: [5,21200]
+};
+
+Object.keys(nrs).forEach((k,i) => {
+ console.log(`Base 10: ${k}
+Base ${nrs[k][0]}: ${nrs[k][1]}
+`)
+});
diff --git a/challenge-107/stuart-little/node/ch-2.js b/challenge-107/stuart-little/node/ch-2.js
new file mode 100755
index 0000000000..175512da34
--- /dev/null
+++ b/challenge-107/stuart-little/node/ch-2.js
@@ -0,0 +1,12 @@
+#!/usr/bin/env node
+
+// run <script> <path-to-module>
+// defaults to the 'os' module
+
+const mdl = (process.argv.length <= 2) ? ('os') : (process.argv[2]);
+const obj = require(mdl);
+
+console.log(
+ Object.getOwnPropertyNames(obj)
+ .filter((key) => (typeof obj[key]) === 'function')
+ );