File tree Expand file tree Collapse file tree 1 file changed +126
-1
lines changed Expand file tree Collapse file tree 1 file changed +126
-1
lines changed Original file line number Diff line number Diff line change 35
35
36
36
* The DOM
37
37
* jQuery
38
- * anything UI related
38
+ * Inheritence
39
39
</ section >
40
40
< section data-markdown >
41
41
## This talk *IS* about
42
42
43
+ * Types
43
44
* Syntax
44
45
* Functional programming
45
46
</ section >
47
+ < section data-markdown >
48
+ ## Let's Jump into it
49
+ </ section >
50
+ < section >
51
+ < section data-markdown >
52
+ # Types
53
+ </ section >
54
+ < section data-markdown >
55
+ ## Objects
56
+
57
+ They are everywhere
58
+ </ section >
59
+ < section data-markdown >
60
+ ## Pick the objects
61
+
62
+ undefined
63
+ null
64
+ "Hello World"
65
+ 1
66
+ new Integer(1)
67
+ new Object()
68
+ {}
69
+ new Array()
70
+ []
71
+ function (x) { return x; }
72
+ </ section >
73
+ </ section >
74
+ < section >
75
+ < section data-markdown >
76
+ # Syntax
77
+ </ section >
78
+ < section data-markdown >
79
+ ## if-else
80
+
81
+ C-style syntax
82
+
83
+ if (x == y) {
84
+ // do something
85
+ } else {
86
+ // do something else
87
+ }
88
+ </ section >
89
+ </ section >
90
+ < section data-markdown >
91
+ # Challenge Time
92
+ </ section >
93
+ < section >
94
+ < section data-markdown >
95
+ ## Replace if, else
96
+
97
+ * Use an Object, true, false and function(s)
98
+ </ sectiotn >
99
+ < section data-markdown >
100
+ ### Original
101
+
102
+ if (a == 'blarg') {
103
+ console.log('Hello');
104
+ } else {
105
+ console.log('Goodbye');
106
+ }
107
+ </ section >
108
+ < section data-markdown >
109
+ ### Answer
110
+
111
+ < pre > < code class ="javascript "> console.log({
112
+ true: 'Hello',
113
+ false: 'Goodbye'
114
+ }[a == 'blarg']);
115
+ </ code > </ pre >
116
+ </ section >
117
+ < section data-markdown >
118
+ ### Original
119
+
120
+ var x, y;
121
+ if (a == 'blarg') {
122
+ x = 2;
123
+ y = [z * 5];
124
+ } else {
125
+ y = 3;
126
+ x = [z / 2];
127
+ }
128
+ </ section >
129
+ < section data-markdown >
130
+ ### Answer
131
+
132
+ {
133
+ true: function () {
134
+ x = 2;
135
+ y = [z * 5];
136
+ },
137
+ false: function () {
138
+ y = 3;
139
+ x = [z / 2];
140
+ }
141
+ }[a == 'blarg']();
142
+ </ section >
143
+ < section data-markdown >
144
+ ### Original
145
+
146
+ var returnValue;
147
+ swtich(val) {
148
+ case 2:
149
+ returnValue = 'A'
150
+ break;
151
+ case 6:
152
+ returnValue = 'B'
153
+ break;
154
+ case 9:
155
+ returnValue = 'B'
156
+ break;
157
+ default:
158
+ returnValue = null;
159
+ }
160
+ return returnValue;
161
+ </ section >
162
+ < section data-markdown >
163
+ ### Answer
164
+
165
+ {2: 'A', 6: 'B', 9: 'C'}[val]
166
+
167
+ Well, almost...
168
+ </ section >
169
+ </ section >
46
170
</ div >
47
171
</ div >
48
172
< script src ="lib/js/head.min.js "> </ script >
49
173
< script src ="js/reveal.min.js "> </ script >
174
+ < script src ="js/scratch-pad.js "> </ script >
50
175
< script >
51
176
// Full list of configuration options available here:
52
177
// https://github.com/hakimel/reveal.js#configuration
You can’t perform that action at this time.
0 commit comments