Skip to content

Commit 39c26e4

Browse files
committed
Start putting in syntax slides and challenges.
1 parent 849d8b8 commit 39c26e4

File tree

1 file changed

+126
-1
lines changed

1 file changed

+126
-1
lines changed

index.html

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,143 @@
3535

3636
* The DOM
3737
* jQuery
38-
* anything UI related
38+
* Inheritence
3939
</section>
4040
<section data-markdown>
4141
## This talk *IS* about
4242

43+
* Types
4344
* Syntax
4445
* Functional programming
4546
</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>
46170
</div>
47171
</div>
48172
<script src="lib/js/head.min.js"></script>
49173
<script src="js/reveal.min.js"></script>
174+
<script src="js/scratch-pad.js"></script>
50175
<script>
51176
// Full list of configuration options available here:
52177
// https://github.com/hakimel/reveal.js#configuration

0 commit comments

Comments
 (0)