The javascript one seems pretty simple, just localStorage.clear().
Is there anything similar to that for the backbone localstorage, and if not, can someone point me
Few ways you can do this from the Collection, but whichever way you choose, you have to call destroy on each model, which will run sync and destroy it on both the client-side and server-side (which localStorage is acting as).
collection.each(function(model) {
model.destroy();
}
)
Update
Per comments, doesn't look like this works anymore. Since this is still marked as the answer, including answer that should work below, per skcin7
.
while ((model=collection.shift()))
{ model.destroy();
}