I’m checking my code with JSHint and I found the following problem that I can’t resolve.
(im using jQuery.js)
Storage.prototype.setObject = function(key, value) {
'Storage' is not defined.
Storage.prototype.getObject = function(key) {
'Storage' is not defined.
Storage.prototype.setObject = function(key, value) {
this.setItem(key, JSON.stringify(value));
};
Storage.prototype.getObject = function(key) {
return JSON.parse(this.getItem(key));
};
How to solve this issue?
You need to declare Storage as a global for JSHint. Add
on the beggining of your file, or with the rest of your JSHint configuration