Skip to content

Commit

Permalink
Node.js, add Q43 and edit Qs 18 and 36 (Ebazhanov#1223)
Browse files Browse the repository at this point in the history
* Add 2 new questions and single quotes on Q18

* Remove Q44 and mark correct answer on Q36
  • Loading branch information
windusayles authored Mar 4, 2021
1 parent 77a3ae6 commit 4f14986
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions node.js/node.js-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ To minimize memory costs, when possible prefer streaming via fs.createReadStream
- [ ] The forked process shares the same VM thread with the parent process.

#### Q18. If EventEmitter is in scope, which of the following lines of code will have an event emitter emitting a change event?
- [x] EventEmitter.emit(change);
- [ ] EventEmitter.new().emit(change);
- [ ] (new EventEmitter()).emit(change);
- [ ] new EventEmitter(change);
- [x] EventEmitter.emit('change');
- [ ] EventEmitter.new().emit('change');
- [ ] (new EventEmitter()).emit('change');
- [ ] new EventEmitter('change');

**Explanation:**

Expand Down Expand Up @@ -239,8 +239,8 @@ fs.appendFilechello.txt'l 'Hello ${user} on ${system}r, (err) => { if (err) thro
- [x] node -h
- [ ] node index.js -h

### Q36. When a request event is received in the HTTP module, what is the type of the first argument passed to that event, usually named req?When a request event is received in the HTTP module, what is the type of the first argument passed to that event, usually named null?
- [ ] http.IncomingMessage
### Q36. When a request event is received in the HTTP module, what is the type of the first argument passed to that event, usually named req?
- [x] http.IncomingMessage
- [ ] http.ServerRequest
- [ ] http.ClientRequest
- [ ] http.ServerResponse
Expand Down Expand Up @@ -280,3 +280,9 @@ fs.appendFilechello.txt'l 'Hello ${user} on ${system}r, (err) => { if (err) thro
- [ ] hash
- [x] crypto
- [ ] TLS

### Q43. Which line imports a promise-based version of the readFile method?
- [x] const { readFile } = require(fs).promises
- [ ] const { readFile } = require(fs)
- [ ] const { readFilePromises: readFile } = require(fs)
- [ ] const { readFile } = require(promises)

0 comments on commit 4f14986

Please sign in to comment.