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

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.

主站蜘蛛池模板: 泰兴市| 武功县| 安顺市| 大竹县| 得荣县| 云林县| 沁水县| 澎湖县| 佳木斯市| 黎川县| 湟中县| 高雄市| 桑植县| 泗阳县| 防城港市| 盱眙县| 荔波县| 天长市| 北辰区| 鄂伦春自治旗| 方正县| 广安市| 梁河县| 新巴尔虎右旗| 安康市| 揭东县| 渭南市| 广南县| 浦东新区| 吉首市| 伊宁市| 深水埗区| 中山市| 尉氏县| 韶关市| 邵东县| 内黄县| 治多县| 通渭县| 正定县| 河源市|