diff options
| author | chirvasitua <stuart-little@users.noreply.github.com> | 2021-04-11 22:14:40 -0400 |
|---|---|---|
| committer | chirvasitua <stuart-little@users.noreply.github.com> | 2021-04-11 22:14:40 -0400 |
| commit | 3e831faee4dc0da0ac273511c38641e0db693497 (patch) | |
| tree | b8b285b2e1dd9cb0f8b22f03a8c06fddc51963e1 /challenge-107 | |
| parent | 31bd2a9940939a27a9b2a0a05aae46b4f3b0d95a (diff) | |
| download | perlweeklychallenge-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-x | challenge-107/stuart-little/node/ch-1.js | 15 | ||||
| -rwxr-xr-x | challenge-107/stuart-little/node/ch-2.js | 12 |
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') + ); |
