You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✓
Submission results match expected
✓
Additional module file exports a single function
✓
Additional module file exports a functionthat takes 3 arguments
✗
Your additional module file [mymodule.js] does not appear to pass back an
error received from fs.readdir(). Use the following idiomatic Node.js
pattern inside your callback to fs.readdir(): if (err) return
callback(err)
'Official' Solution
Here's the official solution in case you want to compare notes:───────────────────────────────────────────────────────────────────────────── _/usr/local/lib/node_modules/learnyounode/exercises/make_it_modular/soluti on/solution.js_ :'use strict' const filterFn = require('./solution_filter.js') const dir = process.argv[2] const filterStr = process.argv[3] filterFn(dir, filterStr, function (err, list) { if (err) { return console.error('There was an error:', err) } list.forEach(function (file) { console.log(file) }) })───────────────────────────────────────────────────────────────────────────── _/usr/local/lib/node_modules/learnyounode/exercises/make_it_modular/soluti on/solution_filter.js_ :'use strict' const fs = require('fs') const path = require('path') module.exports = function (dir, filterStr, callback) { fs.readdir(dir, function (err, list) { if (err) { return callback(err) } list = list.filter(function (file) { return path.extname(file) === '.' + filterStr }) callback(null, list) }) }
The text was updated successfully, but these errors were encountered:
Below, kindly see My Solution and LMK what is the issue with this one in comparison to 'Official' Solution. They seem very similar. 😖
My Solution
'make-it-modular.js'
'mymodule.js'
'Official' Solution
The text was updated successfully, but these errors were encountered: