Example,
function setLocalStorage(key, value){
localStorage.key = value;
}
i want the key param to be the key, but if i code like this
the "key" string becomes the key.
Example,
function setLocalStorage(key, value){
localStorage.key = value;
}
i want the key param to be the key, but if i code like this
the "key" string becomes the key.
If you are looking to add a key to an object with a value:
function setLocalStorage(key, value){
localStorage[key] = value;
}