Last active
October 29, 2017 23:51
-
-
Save constvoidblog/895d428b0748f908aa3b5beea6997e81 to your computer and use it in GitHub Desktop.
A sample function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require(‘fs’); | |
function foo (a, b, f) { | |
new Promise((resolve,reject)=> | |
let c=a*b; | |
fs.writeFile(f,`${a} * ${b} = ${c}`, (err) => { if (err) { console.log(`issue writing data to ${f}: ${err}`); reject (err); } | |
resolve(c); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment