Started the day by working on my TaskTimer project. It's meant to help me keep track of the time spent on various tasks, including my 100DaysOfCode journey. Spent a good chunk of time making sure the script could save the task and time it took on a Python dictionary.
Chapter four of EJS is all about data focusing on objects and arrays. My favorite part about the book this far is the way the author explained how bindings work.
"You should imagine bindings as tentacles, rather than boxes. They do not contain values; they grasp them—two bindings can refer to the same value. A program can access only the values that it still has a reference to. When you need to remember something, you grow a tentacle to hold on to it or you reattach one of your existing tentacles to it." Link
Working on the GitHub to make it public. In the meantime go check out the first version on my website.
- Added hours to the script
- Made that the script saves to a .txt file
- Made that the script reads a .txt file and adds the data to a dictionary
- Made that the script writes the new task added to the dict into a txt file
- Three dot notation to pass individual items from arrays to function arguments.
- What are arrays and objects
- What is JSON
Task "Coding TaskTimer" 1 h 19 min 15 s
Task 'Reading EJS'. Elapsed time: 31 min 19 s
Task 'Excercices of EJS'. Elapsed time: 19 min 57 s
1h 39 min
"Objects and arrays (which are a specific kind of object) provide ways to group several values into a single value. Conceptually, this allows us to put a bunch of related things in a bag and run around with the bag, instead of wrapping our arms around all of the individual things and trying to hold on to them separately.
There are some named properties in arrays, such as length and a number of methods. Methods are functions that live in properties and (usually) act on the value they are a property of.
You can iterate over arrays using a special kind of for loop—for (let element of array)." End of summary, check this part from here
Also, check out FreeCodeCamp the best learning site for beginner coders.
That's it for today. Hope to see you all tomorrow!