Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

function delete localstorage key with prefix

var arr = []; // Array to hold the keys
// Iterate over localStorage and insert the keys that meet the condition into arr
for (var i = 0; i < localStorage.length; i++){
    if (localStorage.key(i).substring(0,3) == 'TM_') {
        arr.push(localStorage.key(i));
    }
}

// Iterate over arr and remove the items by key
for (var i = 0; i < arr.length; i++) {
    localStorage.removeItem(arr[i]);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: validate date 
Javascript :: Get Multipal Tab Value to One App Script 
Javascript :: Stateful/Container/Smart component 
Javascript :: no longer in view js 
Javascript :: javascript check if string contains capital letter 
Javascript :: t_networkless_options":true,"disable_signout_supex_users":true,"desktop_adjust_touch_target":true,"kevlar picker ajax 
Javascript :: google removing javascript from chrome 
Javascript :: nodejs string value check === and !== 
Javascript :: discord.js add role to user 
Javascript :: micromodal scrolls to bottom 
Javascript :: Calling JSON REST Services with FoxPro and wwJsonServiceClient 
Javascript :: all callbacks and function for iCheck plugin 
Javascript :: queen of spain 
Javascript :: how to pop more then one element js 
Javascript :: verificar radio selected 
Javascript :: javascript event get div text 
Javascript :: javascript array game 
Javascript :: call apply mnemonic javascript 
Javascript :: tab in textarea javascript 
Javascript :: angular validar formulario 
Javascript :: dshongphuc/magic-mouse-js 
Javascript :: xslt "node to string" 
Javascript :: constructor function javascript and creating an object from it 
Javascript :: /home/raj/Desktop/webProjects/node-shop-api/node_modules/whatwg-url/dist/encoding.js:2 const utf8Encoder = new TextEncoder(); ^ ReferenceError: TextEncoder is not defined 
Javascript :: google sheets simulate edit event 
Javascript :: fonction fleche js 
Javascript :: bootstrapmaterialdatepicker get selected value on changes 
Javascript :: grab params 
Javascript :: indexOf() usages 
Javascript :: Fabricjs configurations 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =