Do you mean that you want to
?
You can do it like this:
const obj = { foo: 'bar' };
// 1. serialize it
const serializedObj = JSON.stringify(obj);
// 2. store it
localStorage.setItem('obj', serializedObj);
No need to "tokenize" (you probably mean base64-encode) it, though if you really want to do that, just do:
const base64Obj = btoa(serializedObj);
When inspecting the variables:
