Created
June 29, 2012 05:09
-
-
Save mpautasso/3015898 to your computer and use it in GitHub Desktop.
Review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.Hashtable | |
jQuery -> | |
class HashTable | |
constructor: (@obj) -> | |
@length = 0 | |
@items = {} | |
for p of @obj | |
if @obj.hasOwnProperty(p) | |
@items[p] = @obj[p] | |
@length++ | |
getItem: (key) -> | |
if @hasItem(key) | |
value = @items[key] | |
else | |
value = 'Field undefined' | |
return value | |
hasItem: (key) -> | |
return @items.hasOwnProperty key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment