-
Notifications
You must be signed in to change notification settings - Fork 3
/
Task1b.js
42 lines (37 loc) · 1.32 KB
/
Task1b.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// How do I run this script?
// node Task1b.js
todoList = [];
/**
* YOUR OBJECTIVE:
* We do a lot in the addAndPrintTodos() funciton. It's also limited in
* in what it can do because it takes no input.
* Is there a way to seperate the concerns so that they could be tied to particular events
* while also allowing us to add any todos that we want?
*
* Replace the "__" in each of the "__todo" function definitions to create more logical
* function names and define some logic to accomplish these tasks inspired by
* what you did in Part A. Call both function in mainTask1b().
*
* In addition to updating function names, only modify the file under
* the "// YOUR CODE HERE" comments.
*/
function __todo(todoString) {
// YOUR CODE HERE
}
function __todo() {
// YOUR CODE HERE
}
/**
* Main is considered the entry point to a procedural program. Within y/cs,
* it's rare for us to write procedures in JS, but for learning purposes
* we do it here
*/
function mainTask1b() {
// YOUR CODE HERE (simply call the functions you implemented above)
}
// This bit of code ensures that a main method exists! If it doesn't, then it throws an error
if (require.main === module) {
// unlike other languages like Java, there is no built in main method. We use a funciton called
// main by convention.
mainTask1b();
}