mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(storage) for-in -> Object.keys-forEach
This commit is contained in:
parent
fbef38149f
commit
043a2b9613
1 changed files with 4 additions and 5 deletions
|
|
@ -40,15 +40,14 @@ var Util, DOM;
|
|||
};
|
||||
|
||||
this.removeMatch = function(string, callback) {
|
||||
var name, is,
|
||||
reg = new RegExp('^' + string + '.*$');
|
||||
var reg = RegExp('^' + string + '.*$');
|
||||
|
||||
for (name in localStorage) {
|
||||
is = name.match(reg);
|
||||
Object.keys(localStorage).forEach(function(name) {
|
||||
var is = reg.test(name);
|
||||
|
||||
if (is)
|
||||
localStorage.removeItem(name);
|
||||
}
|
||||
});
|
||||
|
||||
Util.exec(callback);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue