Conversation
…Internet Connection
| switch (choice.trim()) { | ||
| case '1': | ||
| rl.question('Enter name:', (name) => { | ||
| rl.question('Enter email:', (email) => { |
There was a problem hiding this comment.
Please add this validation- if the entered email already exists because no two employees can have the same email. Also because you have used email as the key in the delete employee function.
WordScraper/WordScraper.js
Outdated
| function readUrlAndWords(){ | ||
|
|
||
| let urlsSet = new Set() ; | ||
| let wordsSet = new Set(); |
There was a problem hiding this comment.
Please use 'const' here. Variables that are not going to be changed shouldn't be declared with 'var' or 'let'.
WordScraper/WordScraper.js
Outdated
| const response = await axios.get(url); | ||
| const $ = cheerio.load(response.data); | ||
| const textContent = $('body').text().replace(/\r/g, '').trim(); | ||
| return textContent; |
There was a problem hiding this comment.
Use a declarative rather than an imperative approach. The code must follow functional programming concepts.
| case '5': | ||
| console.log('Exiting program.'); | ||
| rl.close(); | ||
| break; |
There was a problem hiding this comment.
Please use 'process.exit(0)' in place of 'break' to exit the program here.
| } | ||
|
|
||
| // Create a readline interface to read user input | ||
| const rl = readline.createInterface({ |
There was a problem hiding this comment.
Should use descriptive variable names. Need to correct this in many places.
… descriptive var name
Completed Module 4:
Higher-order functions
Pure functions
Immutability
Recursion
Function composition
Currying