Destination: localStorage (To-do)
Things I've worked on/completed since my last post…
I have been continuing with To-do….
Issues I had…
I was unable to access an object created on a function call and assigned to a variable, as I had not returned the variable. It took me a little while to find this.
I had a bizarre issue which I could not figure out for ages which was that when I tried to console log a variable, the value of a different variable was being displayed instead. I literally had to go through everything line-by-line and I found that I had added an extra parameter to a function, but had forgotten to add that same parameter to the corresponding function attached to an event listener.
I accidentally passed a global variable into a function as a parameter, which created a second variable of the same name and caused undesired results.
In testing a part of my code, I had put a console log after an ‘if condition’ and before the ‘conditional code’, which affected the output. Looking back, I am not sure why, but for some reason, I did not think this would impact the running of the conditional code - I think that it was because I thought only the code in the parentheses would be run, not realising that since these only represent a codeblock, rather than a ‘prompt’ to run the conditonal code, the console log after the ‘if condition’ was actually being run instead.
e.g.:
if (variable==X)
console.log('test);
{console.log('Variable is equal to X)}
…so instead of logging the second line - the first was being logged and the ‘conditonal code’ was being ignored. It seems obvious looking back, like a lot of things!
Things that went well...
I finished all the logics for multiple projects after quite a long time of dragging. I have doubts about my doubts about file structure, but I admit I am more concerned about getting the project finished at the moment.
I used date-fns to format dates - I only learnt enough to implement dates in the format I wanted, but I think I could manage to do more with it if I had to, using the documentation.
Things I've learnt/need to improve on...
I noticed myself forgetting certain things which were clear (or so I thought) at the beginning of the project - e.g. that I shouldn’t be exporting mutable variables in order to maintain more control over them. I attribute this to spending so much time fixing the logic, I think some of these things I had looked at earlier just slipped my mind.
I have just started looking at local storage, so just trying to make sense of it at the moment - will update here once I understand it better.
Plan for the forthcoming week...
I will be working on finishing Local Storage.