官术网_书友最值得收藏!

Moving functionality into individual functions

To resolve the problem, I'd like to get started by creating two new functions:

  • fetchNotes
  • saveNotes

The first function, fetchNotes, will be an arrow function, and it will not to take any arguments since it will be fetching notes from the filesystem, as shown here:

var fetchNotes = () => {

};

The second function, saveNotes, will need to take an argument. It will need to take the notes array you want to save to the filesystem. We'll set it equal to an arrow function, and then we'll provide our argument, which I will name notes, as shown here:

var saveNotes = (notes) => {

};

Now that we have these two functions, we can go ahead and start moving some of the functionality from addNote up into the individual functions.

主站蜘蛛池模板: 固安县| 靖西县| 云南省| 罗定市| 阜城县| 屏边| 星座| 宁强县| 葵青区| 富顺县| 翁源县| 枣阳市| 衡阳县| 修武县| 徐汇区| 句容市| 东港市| 贺兰县| 温宿县| 呈贡县| 双峰县| 辽宁省| 阳东县| 忻州市| 自治县| 牟定县| 明水县| 荃湾区| 鄂州市| 双辽市| 库尔勒市| 夏津县| 江门市| 海林市| 禹州市| 富平县| 逊克县| 登封市| 南溪县| 山西省| 霞浦县|