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

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.

主站蜘蛛池模板: 辽阳县| 青州市| 翁牛特旗| 伊通| 邳州市| 巴彦县| 彰化市| 斗六市| 锦屏县| 阿图什市| 龙里县| 太原市| 丹寨县| 平遥县| 江北区| 老河口市| 甘洛县| 宝山区| 和政县| 肥西县| 门源| 柘荣县| 祁连县| 龙游县| 青海省| 闽侯县| 建水县| 鹿泉市| 威海市| 尼木县| 手游| 砚山县| 娄烦县| 特克斯县| 昌平区| 富阳市| 福安市| 开鲁县| 呼玛县| 靖安县| 利辛县|