Recommend this page to a friend! |
Download .zip |
Info | View files (13) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2013-04-26 (3 years ago) | Not enough user ratings | Total: 159 | All time: 291 This week: 22 |
Version | License | JavaScript version | Categories | |||
multi-key 1.0 | GNU General Publi... | 1.0 | Data types |
Description | Author | ||||||||||||||
This object can set and get values from arrays using multiple keys. Innovation Award
|
|
multiKey ======== Let you create a multi key array map. Example: Setter and Getter -------------------------- ```javascript var map = Multikey(); map.set(['foo', 'var'], 'test1'); map.set(['foo2', 'var'], 'test2'); map.set(['foo', 'var2'], 'test3'); map.get('foo', 'var'); // return 'test1' map.get('foo2', 'var'); // return 'test2' map.get('foo', 'var2'); // return 'test3' ``` Methods: -------- set([arg1[, arg2 [, argN]]], value); ```javascript var map = Multikey(); map.set(['foo', 'var'], 'value1'); ``` get(arg1[, arg2 [, argN ] ]); ```javascript var map = Multikey(); map.get('foo', 'var'); // returns 'value1' ``` each(callback); ```javascript var map = Multikey(); map.each(function(index, mapItem){ //your script }); ``` getKeys(); ```javascript var map = Multikey(); map.set(['foo', 'var'], 'value1'); map.set(['foo1', 'var1'], 'value2'); map.set(['foo2', 'var3'], 'value3'); mar.getKeys(); // returns ['foo', 'foo1', 'foo2'] ``` |
Files |
File | Role | Description | ||
---|---|---|---|---|
test (6 files, 1 directory) | ||||
compile.sh | Data | Auxiliary data | ||
jcamelis.multiKey.js | Class | Class source | ||
jcamelis.multiKey.min.js | Class | Class source | ||
license.txt | Doc. | Documentation | ||
README.md | Data | Auxiliary data |
Files | / | test |
File | Role | Description | ||
---|---|---|---|---|
lib (2 files) | ||||
development.html | Doc. | Documentation | ||
each.js | Test | Unit test script | ||
getKeys.js | Test | Unit test script | ||
makeArray.js | Test | Unit test script | ||
minify.html | Doc. | Documentation | ||
setter_getter.js | Test | Unit test script |
Files | / | test | / | lib |
File | Role | Description |
---|---|---|
qunit-1.11.0.css | Data | Auxiliary data |
qunit-1.11.0.js | Test | Unit test script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.