Guest User

Untitled

a guest
Feb 25th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // Learning JavaScript
  2. // chapter 14 : Asynchronous Programming
  3.  
  4. // Callback Hell!!
  5.  
  6. const fs = require('fs');
  7.  
  8. function readSketchyFile() {
  9. try {
  10. fs.readFile('does_not_exist.txt', function(err, data) {
  11. if (err) throw err;
  12. });
  13. } catch (err) {
  14. console.log('warning : minor issue occurred, program continuing ');
  15. }
  16. }
  17. readSketchyFile();
Add Comment
Please, Sign In to add comment