-
Notifications
You must be signed in to change notification settings - Fork 1
/
each.html
84 lines (62 loc) · 1.59 KB
/
each.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI 3.0</title>
<script type="text/javascript" src="../../build/yui/yui-debug.js"></script>
<script type="text/javascript" src="../../build/oop/oop-debug.js"></script>
<script type="text/javascript" src="../../build/dump/dump-debug.js"></script>
<script type="text/javascript">
(function() {
var Y = YUI().use('*');
var newobj = {};
var o = {
str: "str",
arr: [
"array1",
true,
{ obj: "obj"},
["array2"]
],
dat: new Date(),
fn: function() {
},
//win: window,
nada: null
};
Y.use('yui');
// return;
Y.each(o, function(v, k) {
Y.log("Each: " + k + ": " + Y.Lang.dump(v) + " ~ " + Y.Lang.dump(this));
Y.log("same? " + (this === newobj));
this[k] = v;
this.asdf = "asdf";
}, newobj);
Y.log("each: " + Y.Lang.dump(newobj));
var o1 = {
a: "a",
b: "b",
c: {
d: "d",
e: "e",
f: ["g", "h", "i"]
}
};
var o2 = {
a: "a2",
c: {
d: "d",
e: "e",
f: ["g2", "h2", "i2"],
j: "j2"
},
k: "k2"
};
// Y.mix(o1, o2, false, null, 0, true);
Y.aggregate(o1, o2);
Y.log("aggregate: " + Y.Lang.dump(o1));
})();
</script>
<body>
<input id="addButton" type="button" value="Add link" />
</body>
</html>