Added example.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
var cache = {};
|
||||
|
||||
exports.put = function (key, value) {
|
||||
cache[key] = value;
|
||||
}
|
||||
|
||||
exports.containsKey = function (key) {
|
||||
return typeof cache[key] != "undefined";
|
||||
}
|
||||
|
||||
exports.get = function (key) {
|
||||
return cache[key];
|
||||
}
|
||||
|
||||
exports.delete = function (key) {
|
||||
delete cache[key];
|
||||
}
|
||||
|
||||
exports.clear = function () {
|
||||
cache = {};
|
||||
}
|
||||
Reference in New Issue
Block a user