Storage userData data
<code class="javascript">localstorage.setItem("userData",JSON.stringify(userData));</code>
Why is it so troublesome to convert data into strings
and then take it out and then convert it into an object?
Storing the object directly, isn’t it okay to take out the object and use it directly?
Storage userData data
<code class="javascript">localstorage.setItem("userData",JSON.stringify(userData));</code>
Why is it so troublesome to convert data into strings
and then take it out and then convert it into an object?
Storing the object directly, isn’t it okay to take out the object and use it directly?
For some data with abstract data structures, such as binary trees and objects, it is not linear compared to arrays, so when the TCP protocol transmits data, it needs to be converted into something similar to an array, and then inserted into the network stream (similar to a pipeline ) inside, and then restore the original shape on the other side (just like when transporting a bed, you need to disassemble it first, and then put the bed boards back together at the destination).
https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem
Function signature not allowed