January 2018
Beginner
658 pages
13h 10m
English
The first step in the process will be to define the new function. In notes.js, I'll set module.exports.add equal to that function, as shown here:
console.log('Starting notes.js');module.exports.addNote = () => { console.log('addNote'); return 'New note';}; module.exports.add =
Let's set it equal to an arrow function. If you used a regular function, that is perfectly fine, I just prefer using the arrow function when I can. Also, inside parentheses, we will be getting two arguments, we'll be getting a and b, as shown here:
console.log('Starting notes.js');module.exports.addNote = () => { console.log('addNote'); return 'New note';}; module.exports.add = (a, b) => {};
All we need to do is return the result, which is really ...
Read now
Unlock full access