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,14 @@
var assoc = {};
assoc['foo'] = 'bar';
assoc['another-key'] = 3;
assoc.thirdKey = 'we can also do this!'; // dot notation can be used if the property name
// is a valid identifier
assoc[2] = 'the index here is the string "2"';
assoc[null] = 'this also works';
assoc[(function(){return 'expr';})()] = 'Can use expressions too';
for (var key in assoc) {
if (assoc.hasOwnProperty(key)) {
alert('key:"' + key + '", value:"' + assoc[key] + '"');
}
}

View file

@ -0,0 +1,4 @@
var assoc = {
foo: 'bar',
'another-key': 3 //the key can either be enclosed by quotes or not
};

View file

@ -0,0 +1 @@
'foo' in assoc // true