MCQs > IT & Programming > Node.js > A module 'rimraf' is installed locally in a Node.js project. The following code snippet is supposed to delete a directory named testing2 from the same project however the code contains some errors identify which code lines contain an error. 1.var rim1 = require('rimraf'); 2.rimraf('./Testing2', function(error1)){ 3. if(error1) console.log('This is an error', error1); 4. else console.log('Directory deleted successfully'); 5.}

Node.js MCQs

A module 'rimraf' is installed locally in a Node.js project.

The following code snippet is supposed to delete a directory named testing2 from the same project however the code contains some errors identify which code lines contain an error.

1.var rim1 = require('rimraf'); 

2.rimraf('./Testing2', function(error1)){ 

3. if(error1) console.log('This is an error', error1); 

4. else console.log('Directory deleted successfully'); 

5.}

Answer

Correct Answer:

Lines 2 and 5  

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it