{"action":"opened","issue":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/1497","labels_url":"https://api.github.com/repos/nodeschool/discussions/issues/1497/labels{/name}","comments_url":"https://api.github.com/repos/nodeschool/discussions/issues/1497/comments","events_url":"https://api.github.com/repos/nodeschool/discussions/issues/1497/events","html_url":"https://github.com/nodeschool/discussions/issues/1497","id":111426307,"number":1497,"title":"I can't make Filtered LS work","user":{"login":"stevensgarcia","id":8174929,"avatar_url":"https://avatars.githubusercontent.com/u/8174929?v=3","gravatar_id":"","url":"https://api.github.com/users/stevensgarcia","html_url":"https://github.com/stevensgarcia","followers_url":"https://api.github.com/users/stevensgarcia/followers","following_url":"https://api.github.com/users/stevensgarcia/following{/other_user}","gists_url":"https://api.github.com/users/stevensgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/stevensgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevensgarcia/subscriptions","organizations_url":"https://api.github.com/users/stevensgarcia/orgs","repos_url":"https://api.github.com/users/stevensgarcia/repos","events_url":"https://api.github.com/users/stevensgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/stevensgarcia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-14T15:42:41Z","updated_at":"2015-10-14T15:42:41Z","closed_at":null,"body":"Hello everyone,\r\n\r\nI'm trying to solve the Filtered LS nodeschool exercise, but I got an error with __.extname()__ method. I don't understand why doesn't work, since I'm using the method correctly *\"I think\"*.\r\n\r\n```javascript\r\n// req module\r\nvar fs = require(\"fs\");\r\n\r\n/**\r\n * Read directory files\r\n * @param {array} process.argv[2] Directory path passed as an argument in CLI\r\n */\r\nfs.readdir(process.argv[2], function(err, list) {\r\n  // handle the error\r\n  if (err) {\r\n    console.log(err.message);\r\n  }\r\n\r\n  // add dot \".\" to the extension provided\r\n  var filter = \".\" + process.argv[3];\r\n\r\n  // print filtered file names\r\n  for (var i = 0, len = list.length; i < len; i++) {\r\n\r\n    if (process.argv[2].extname(list[i]) === filter) {\r\n      console.log(list[i]);\r\n    }\r\n\r\n  }\r\n});\r\n```\r\n\r\nThis is the output using **$learnyounode verify ex5.js**\r\n\r\n```\r\n[Stevens@cli-sgarcia] learnyounode !142 $ learnyounode verify ex5.js \r\n\r\n/Applications/MAMP/htdocs/nodeschool/learnyounode/ex5.js:21\r\n    if (process.argv[2].extname(list[i]) === filter) {\r\n                        ^\r\nTypeError: Object /var/folders/8_/zzb88fdd74q09mds5v8dgxv40000gn/T/_learnyounode_9621 has no method 'extname'\r\n    at /Applications/MAMP/htdocs/nodeschool/learnyounode/ex5.js:21:25\r\n    at Object.oncomplete (fs.js:108:15)\r\n\r\nYour submission results compared to the expected:\r\n\r\n                 ACTUAL                                 EXPECTED                \r\n────────────────────────────────────────────────────────────────────────────────\r\n\r\n   \"\"                                  !=    \"CHANGELOG.md\"                     \r\n                                       !=    \"LICENCE.md\"                       \r\n                                       !=    \"README.md\"                        \r\n                                       !=    \"\"                                 \r\n\r\n────────────────────────────────────────────────────────────────────────────────\r\n\r\n✗ Submission results did not match expected!\r\n✓ Used asynchronous method: fs.readdir()\r\n\r\n# FAIL\r\n```\r\n\r\n#### Versions:\r\n\r\n* node 0.10.13\r\n* npm 1.4.28\r\n* nvm 0.25.1\r\n\r\n**Thanks in advanced!**"}}