Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function naiveHashing()
- {
- var keys = [];
- var values = [];
- this.save = function (key, value) {
- var existingIndex = ko.utils.arrayIndexOf(keys, key);
- if (existingIndex >= 0) values[existingIndex] = value;
- else {
- keys.push(key);
- values.push(value);
- }
- };
- this.get = function (key) {
- var existingIndex = ko.utils.arrayIndexOf(keys, key);
- return (existingIndex >= 0) ? values[existingIndex] : undefined;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement