Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
|
|
@ -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] + '"');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
var assoc = {
|
||||
foo: 'bar',
|
||||
'another-key': 3 //the key can either be enclosed by quotes or not
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
'foo' in assoc // true
|
||||
Loading…
Add table
Add a link
Reference in a new issue