- Learning Node.js Development
- Andrew Mead
- 136字
- 2021-06-30 18:56:59
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.
推薦閱讀
- 自動駕駛網絡:自智時代的網絡架構
- Mastering Machine Learning for Penetration Testing
- MERN Quick Start Guide
- 重新定義Spring Cloud實戰
- 新一代物聯網架構技術:分層算力網絡
- 數字通信同步技術的MATLAB與FPGA實現:Altera/Verilog版(第2版)
- 計算機網絡工程實用教程(第2版)
- Spring 5.0 Projects
- 網絡環境中基于用戶視角的信息質量評價研究
- 6G:面向2030年的移動通信
- 夢工廠之材質N次方:Maya材質手冊
- 紅藍攻防:構建實戰化網絡安全防御體系
- Getting Started with nopCommerce
- 園區網絡架構與技術
- 計算機網絡技術