Constructor
Least Recently Used cache
Parameters:
Setting constructor loop
Method evict
Evicts the least recently used item from cache
Returns an Object
(LRU instance)
Method get
Gets cached item and moves it to the front
Parameters:
Returns a Mixed
(Undefined or Item value)
Method remove
Removes item from cache
Parameters:
Returns an Object
(LRUItem instance)
Method set
Sets item in cache as first
Parameters:
key must be a String.
(Item key)
value can be of any type.
(Item value)
Returns an Object
(LRU instance)
Constructor
LRU Item factory
Parameters:
Setting prototype & constructor loop
Method lru
LRU factory
Parameters:
([Optional] Max size of cache, default is 1000)
Returns an Object
(LRU instance)