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

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.

主站蜘蛛池模板: 镇巴县| 松潘县| 永德县| 西林县| 恩平市| 丹寨县| 柞水县| 岳普湖县| 广宁县| 东明县| 洛南县| 凤冈县| 闵行区| 深州市| 彭山县| 武邑县| 新乡县| 江华| 西丰县| 天长市| 蕉岭县| 柳江县| 元阳县| 图们市| 眉山市| 汉源县| 改则县| 徐水县| 鹤壁市| 漳浦县| 大港区| 收藏| 璧山县| 梨树县| 开远市| 宁蒗| 抚顺县| 黄平县| 上虞市| 理塘县| 社会|