The item you retrieve is a string, as you saved it with JSON.stringify(). To view it in its original form before saving, you need to use JSON.parse().
Use getItem() to retrieve the myTaskArr array again. This time, wrap it inside JSON.parse(), assign it to the variable getTaskArrObj and log the getTaskArrObj to the console.
Check the console to see the difference between getTaskArr and getTaskObj.
However, getTaskObj is not defined during this course (not so far, at least), and Iāve successfully completed the step by checking getTaskArrObj in the console, which is the variable that I was required to define in this step.
The āassign it to the variable getTaskArrObjā part could be misinterpreted as the variable already existing and only asking for an assignment.
Maybe just changing it to āa variableā instead of āthe variableā would be enough?
Use getItem() to retrieve the myTaskArr array again. This time, wrap it inside JSON.parse() , assign it to the variable getTaskArrObj and log the getTaskArrObj to the console.
Could be updated to:
Use getItem() to retrieve the myTaskArr array again. This time, wrap it inside JSON.parse() , assign it to a variable getTaskArrObj and log the getTaskArrObj to the console.
Or we could be more explicit about it
Use getItem() to retrieve the myTaskArr array again. This time, wrap it inside JSON.parse(). Declare a getTaskArrObj variable and assign it to that variable, then log the getTaskArrObj to the console.
Iām not sure what youāre talking about here, and there might be a misunderstanding. The typo is at the bottom of the step, āCheck the console to see the difference between getTaskArr and getTaskObj.ā
getTaskObj should be getTaskArrObj, because that is the variable that this step instructs you to declare. I was not told to declare a getTaskObj variable. That is the typo.
Edit: Also, I am new to coding, so maybe Iām using the wrong terminology. I do seem to use the words ādefineā and ādeclareā interchangeably. Maybe thatās where I confused you? Iām not sure if those words all mean the same.
I would prefer just tasks or todos. Same for the storage key, not sure why it is called data and not what the data is, data seems a little too generic.
Since this step is just showing the difference between the raw and parsed storage, we could just add āparsedā to the variable name.