Add all the A tasks

This commit is contained in:
Ingy döt Net 2013-04-10 14:58:50 -07:00
parent 2dd7375f96
commit 051504d65b
1608 changed files with 18584 additions and 0 deletions

View file

@ -0,0 +1,15 @@
var myhash = {}; // a new, empty object
myhash["hello"] = 3;
myhash.world = 6; // obj.name is equivalent to obj["name"] for certain values of name
myhash["!"] = 9;
var output = '', // initialise as string
key;
for (key in myhash) {
if (myhash.hasOwnProperty(key)) {
output += "key is: " + key;
output += " => ";
output += "value is: " + myhash[key]; // cannot use myhash.key, that would be myhash["key"]
output += "\n";
}
}

View file

@ -0,0 +1,13 @@
var myhash = {}; // a new, empty object
myhash["hello"] = 3;
myhash.world = 6; // obj.name is equivalent to obj["name"] for certain values of name
myhash["!"] = 9;
var output = '', // initialise as string
val;
for (val in myhash) {
if (myhash.hasOwnProperty(val)) {
output += "myhash['" + val + "'] is: " + myhash[val];
output += "\n";
}
}