-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.html
4047 lines (3820 loc) · 368 KB
/
README.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="Author" content="Bryan Guner">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Mobile Meta -->
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Site Meta -->
<meta name="description" content="Resource-sharing-hub">
<meta name="author" content="Bryan Guner">
<!-- Site Icons -->
<!-- Basic -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Mobile Meta -->
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet" href="./prism.css">
<link rel="stylesheet" href="./readme.css">
<script async defer src="./prism.js"></script>
</head>
</style>
</head>
<body>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/bgoonz/lambda-prep" class="github-corner"
aria-label="View source on Github">
<svg width="80" height="80" viewBox="0 0 250 250"
style="z-index: 100000; fill:#194ccdaf; color:#fff; position: fixed; top: 20px; border: 0; left: 20px; transform: scale(-1.5, 1.5);"
aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor" class="octo-body"></path>
</svg>
</a>
<div class="container">
<!-------------------------------------->
<!-------------------------------------->
<center>
<a target="_blank" rel="noopener noreferrer" href="https://lambda-prep.netlify.app/">
<img src="https://img.icons8.com/pastel-glyph/64/000000/home.png">
</a>HOME
</a>
</center>
<!------------------------------------------->
<h1 id="prep-work">Prep-Work</h1>
<h1 id="notes"><strong>Notes</strong></h1>
<h2 id="how-to-learn-effectively"><strong>How to learn effectively</strong></h2>
<p><strong>Learning</strong>: The acquisition of skills and the ability to apply them in the future.</p>
<p><strong>What makes an Effective learner?</strong></p>
<ul>
<li>They are active listeners.</li>
<li>They are engaged with the material.</li>
<li>They are receptive of feedback.</li>
<li>They are open to difficulty.</li>
</ul>
<p><strong>Why do active learning techniques feel difficult?</strong></p>
<ul>
<li>It feels difficult because you are constantly receiving feedback, and so you are constantly adapting and
perfecting the material.</li>
</ul>
<p><strong>Desirable Difficulty</strong></p>
<ul>
<li>The skills we wish to obtain is often a difficult one.</li>
<li>We want challenging but possible lessons based on current level of skill.</li>
</ul>
<p><strong>Effective learners space their practice</strong></p>
<ul>
<li>Consistent effort > cramming => for <strong>durable knowledge</strong></li>
</ul>
<hr>
<h2 id="hello-world"><strong>Hello World</strong></h2>
<ul>
<li>
<p><strong>console.log</strong> : command used to print something onto the screen.</p>
</li>
<li><strong>syntax</strong> : the exact arrangement of the symbols, characters, and keywords in our code.</li>
<li><strong>//</strong> : notation for creating a code comment in JS.</li>
<li>
<p><strong>code comment</strong> : useful for annotating pieces of code to explain how something works,
ignored by computer.</p>
</li>
</ul>
<blockquote>
<p>“Simplicity is prerequisite for reliability.” – Edsger W. Dijkstra</p>
</blockquote>
<hr>
<h2 id="the-number-data-type"><strong>The Number Data Type</strong></h2>
<p>The <strong>number</strong> data type in JS is used to represent any numerical values, including integers and
decimal numbers.</p>
<p><strong>Basic Arithmetic Operators</strong></p>
<p>Operators are the symbols that perform particular operations.</p>
<ul>
<li><strong>+</strong> (addition)</li>
<li><strong>-</strong> (subtraction)</li>
<li><strong>asterisk</strong> (multiplication)</li>
<li><strong>/</strong> (division)</li>
<li><strong>%</strong> (modulo)</li>
</ul>
<p>JS evaluates more complex expressions using the general math order of operations aka PEMDAS.</p>
<ul>
<li><strong>PEMDAS</strong> : Parentheses, Exponents, Multiplication, Division, Modulo, Addition, Subtraction.
</li>
<li><em>To force a specific order of operation, use the group operator ( ) around a part of the
expression.</em></li>
</ul>
<p><strong>Modulo</strong> : Very useful operation to check divisibility of numbers, check for even & odd,
whether a number is prime, and much more! <em>(Discrete Math concept, circular problems can be solved with
modulo)</em></p>
<ul>
<li>
<p>Whenever you have a smaller number % a larger number, the answer will just be the initial small number.
</p>
<div class="sourceCode" id="cb1">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="0"><code class="sourceCode javascript"><a class="sourceLine" id="cb1-1" title="1"><span class="va">console</span>.<span class="at">log</span>(<span class="dv">7</span> <span class="op">%</span> <span class="dv">10</span>)<span class="op">;</span> <span class="co">// => 7;</span></a></code></pre>
</div>
</li>
</ul>
<hr>
<h2 id="the-string-data-type"><strong>The String Data Type</strong></h2>
<p>The <strong>string</strong> data type is a primitive data type that used to represent textual data.</p>
<ul>
<li>can be wrapped by either <strong>single</strong> or <strong>double</strong> quotation marks, <em>best to
choose one and stick with it for consistency</em>.</li>
<li>
<p>If your string contains quotation marks inside, can layer single or double quotation marks to allow it to
work.</p>
<div class="sourceCode" id="cb2">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="1"><code class="sourceCode javascript"><a class="sourceLine" id="cb2-1" title="1"><span class="st">"That's a great string"</span><span class="op">;</span> (valid)</a>
<a class="sourceLine" id="cb2-2" title="2"></a>
<a class="sourceLine" id="cb2-3" title="3"><span class="st">'Shakespeare wrote, "To be or not to be"'</span><span class="op">;</span> (valid)</a>
<a class="sourceLine" id="cb2-4" title="4"></a>
<a class="sourceLine" id="cb2-5" title="5"><span class="st">'That'</span>s a bad string<span class="st">'; (invalid)</span></a></code></pre>
</div>
<ul>
<li>Alt. way to add other quotes within strings is to use template literals.</li>
</ul>
<div class="sourceCode" id="cb3">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="2"><code class="sourceCode javascript"><a class="sourceLine" id="cb3-1" title="1"><span class="vs">`This is a temp'l'ate literal </span><span class="sc">${</span><span class="kw">function</span><span class="sc">}</span><span class="vs">`</span> <span class="co">// use ${} to invoke functions within.</span></a></code></pre>
</div>
</li>
<li><strong>.length</strong> : property that can be appended to data to return the length.
<ul>
<li>empty strings have a length of zero.</li>
</ul>
</li>
<li>
<p><strong>indices</strong> : indexes of data that begin at 0, can call upon index by using the bracket
notation [ ].</p>
<div class="sourceCode" id="cb4">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="3"><code class="sourceCode javascript"><a class="sourceLine" id="cb4-1" title="1"><span class="va">console</span>.<span class="at">log</span>(<span class="st">"bootcamp"</span>[<span class="dv">0</span>])<span class="op">;</span> <span class="co">// => "b"</span></a>
<a class="sourceLine" id="cb4-2" title="2"><span class="va">console</span>.<span class="at">log</span>(<span class="st">"bootcamp"</span>[<span class="dv">10</span>])<span class="op">;</span> <span class="co">// => "undefined"</span></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="va">console</span>.<span class="at">log</span>(<span class="st">"boots"</span>[<span class="dv">1</span> <span class="op">*</span> <span class="dv">2</span>])<span class="op">;</span> <span class="co">// => "o"</span></a>
<a class="sourceLine" id="cb4-4" title="4"><span class="va">console</span>.<span class="at">log</span>(<span class="st">"boots"</span>[<span class="st">"boot"</span>.<span class="at">length</span> <span class="op">-</span> <span class="dv">1</span>])<span class="op">;</span> <span class="co">// => "t"</span></a></code></pre>
</div>
<ul>
<li>we can pass expressions through the brackets as well since JS always evaluates expressions first.</li>
</ul>
</li>
<li>The index of the last character of a string is always one less than it’s length.</li>
<li>
<p><strong>indexOf()</strong> : method used to find the first index of a given character within a string.
</p>
<div class="sourceCode" id="cb5">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="4"><code class="sourceCode javascript"><a class="sourceLine" id="cb5-1" title="1"><span class="va">console</span>.<span class="at">log</span>(<span class="st">"bagel"</span>.<span class="at">indexOf</span>(<span class="st">"b"</span>))<span class="op">;</span> <span class="co">// => 0</span></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="va">console</span>.<span class="at">log</span>(<span class="st">"bagel"</span>.<span class="at">indexOf</span>(<span class="st">"z"</span>))<span class="op">;</span> <span class="co">// => -1</span></a></code></pre>
</div>
<ul>
<li>if the character inside the indexOf() search does not exist in the string, the output will be -1.</li>
<li>the indexOf() search will return the first instanced index of the the char in the string.</li>
<li><strong>concatenate</strong> : word to describe joining strings together into a single string.</li>
</ul>
</li>
</ul>
<hr>
<h2 id="the-boolean-data-type"><strong>The Boolean Data Type</strong></h2>
<p>The <strong>boolean</strong> data type is the simplest data type since there are only two values:
<strong>true</strong> and <strong>false</strong>.</p>
<ul>
<li>
<p><strong>Logical Operators</strong> (B<em>oolean Operators</em>) are used to establish logic in our code.
</p>
<ul>
<li>
<p><strong>!</strong> (not) : reverses a boolean value.</p>
<div class="sourceCode" id="cb6">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="5"><code class="sourceCode javascript"><a class="sourceLine" id="cb6-1" title="1"><span class="va">console</span>.<span class="at">log</span>(<span class="op">!</span><span class="kw">true</span>)<span class="op">;</span> <span class="co">// => false</span></a>
<a class="sourceLine" id="cb6-2" title="2"><span class="va">console</span>.<span class="at">log</span>(<span class="op">!!</span><span class="kw">false</span>)<span class="op">;</span> <span class="co">// => false</span></a></code></pre>
</div>
</li>
<li>
<p><strong>&&</strong> (and) <strong>Truth Table</strong></p>
<table>
<thead>
<tr class="header">
<th>Input</th>
<th>Input</th>
<th>Output</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>T</td>
<td>T</td>
<td>T</td>
</tr>
<tr class="even">
<td>T</td>
<td>F</td>
<td>F</td>
</tr>
<tr class="odd">
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr class="even">
<td>F</td>
<td>F</td>
<td>F</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>||</strong> (or) <strong>Truth Table</strong></p>
<table>
<thead>
<tr class="header">
<th>Input</th>
<th>Input</th>
<th>Output</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>T</td>
<td>T</td>
<td>T</td>
</tr>
<tr class="even">
<td>T</td>
<td>F</td>
<td>T</td>
</tr>
<tr class="odd">
<td>F</td>
<td>T</td>
<td>T</td>
</tr>
<tr class="even">
<td>F</td>
<td>F</td>
<td>F</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
<li><strong>Logical Order of Operations</strong> : JS will evaluate !, then &&, then ||.</li>
<li>
<p><strong>De Morgan’s Law</strong> : Common mistake in boolean logic is incorrectly distributing ! across
parentheses.</p>
<div class="sourceCode" id="cb7">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="6"><code class="sourceCode javascript"><a class="sourceLine" id="cb7-1" title="1"><span class="op">!</span>(A <span class="op">||</span> B) <span class="op">===</span> <span class="op">!</span>A <span class="op">&&</span> <span class="op">!</span>B<span class="op">;</span></a>
<a class="sourceLine" id="cb7-2" title="2"><span class="op">!</span>(A <span class="op">&&</span> B) <span class="op">===</span> <span class="op">!</span>A <span class="op">||</span> <span class="op">!</span>B<span class="op">;</span></a></code></pre>
</div>
<ul>
<li>In summary, to correctly distribute ! across parentheses we must also flip the operation within.</li>
</ul>
</li>
<li>
<p><strong>Short-Circuit Evaluation</strong> : Because JS evalutes from left to right, expressions can
“short-circuit”. For example if we have true on the left of an || logical comparison, it will stop
evaluating and yield true instead of wasting resources on processing the rest of the statement.</p>
<div class="sourceCode" id="cb8">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="7"><code class="sourceCode javascript"><a class="sourceLine" id="cb8-1" title="1"><span class="va">console</span>.<span class="at">log</span>(<span class="kw">true</span> <span class="op">||</span> <span class="op">!</span><span class="kw">false</span>)<span class="op">;</span> <span class="co">// => stops after it sees "true ||"</span></a></code></pre>
</div>
<hr>
</li>
</ul>
<h2 id="comparison-operators"><strong>Comparison Operators</strong></h2>
<p>All comparison operators will result in a boolean output.</p>
<p><strong>The relative comparators</strong></p>
<ul>
<li><strong>></strong> (greater than)</li>
<li><strong><</strong> (less than)</li>
<li><strong>>=</strong> (greater than or equal to)</li>
<li><strong><=</strong> (less than or equal to)</li>
<li><strong>===</strong> (equal to)</li>
<li><strong>!==</strong> (not equal to)</li>
</ul>
<blockquote>
<p>Fun Fact: “a” < “b” is considered valid JS Code because string comparisons are compared
lexicographically (meaning dictionary order), so “a” is less than “b” because it appears earlier!</p>
</blockquote>
<blockquote>
<p>If there is ever a standstill comparison of two string lexicographically (i.e. app vs apple) the
comparison will deem the shorter string lesser.</p>
</blockquote>
<p><strong>Difference between == and ===</strong></p>
<ul>
<li><strong>===</strong> : Strict Equality, will only return true if the two comparisons are entirely the
same.</li>
<li><strong>==</strong> : Loose Equality, will return true even if the values are of a different type, due to
coercion. (Avoid using this)</li>
</ul>
<hr>
<h2 id="variables"><strong>Variables</strong></h2>
<p>Variables are used to store information to be referenced and manipulated in a program.</p>
<ul>
<li>
<p>We initialize a variable by using the <strong>let</strong> keyword and a <strong>=</strong> single equals
sign (assignment operator).</p>
<div class="sourceCode" id="cb9">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="8"><code class="sourceCode javascript"><a class="sourceLine" id="cb9-1" title="1"><span class="kw">let</span> bootcamp <span class="op">=</span> <span class="st">"Lambda"</span><span class="op">;</span></a>
<a class="sourceLine" id="cb9-2" title="2"><span class="va">console</span>.<span class="at">log</span>(bootcamp)<span class="op">;</span> <span class="co">// "Lambda"</span></a></code></pre>
</div>
</li>
<li>JS variable names can contain any alphanumeric characters, underscores, or dollar signs (cannot being with
a number).</li>
<li>
<p>If you do not declare a value for a variable, undefined is automatically set.</p>
<div class="sourceCode" id="cb10">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="9"><code class="sourceCode javascript"><a class="sourceLine" id="cb10-1" title="1"><span class="kw">let</span> bootcamp<span class="op">;</span></a>
<a class="sourceLine" id="cb10-2" title="2"><span class="va">console</span>.<span class="at">log</span>(bootcamp)<span class="op">;</span> <span class="co">// undefined</span></a></code></pre>
</div>
</li>
<li>We can change the value of a previously declared variable (let, not const) by re-assigning it another
value.</li>
<li>
<p><strong>let</strong> is the updated version of <strong>var</strong>; there are some differences in terms
of hoisting and global/block scope - will be covered later in the course (common interview question!)</p>
</li>
</ul>
<p><strong>Assignment Shorthand</strong></p>
<div class="sourceCode" id="cb11">
<pre class="sourceCode js" data-initialized="true"
data-gclp-id="10"><code class="sourceCode javascript"><a class="sourceLine" id="cb11-1" title="1"><span class="kw">let</span> num <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></a>
<a class="sourceLine" id="cb11-2" title="2">num <span class="op">+=</span> <span class="dv">10</span><span class="op">;</span> <span class="co">// same as num = num + 10</span></a>
<a class="sourceLine" id="cb11-3" title="3">num <span class="op">-=</span> <span class="dv">2</span><span class="op">;</span> <span class="co">// same as num = num - 2</span></a>
<a class="sourceLine" id="cb11-4" title="4">num /<span class="op">=</span> <span class="dv">4</span><span class="op">;</span> <span class="co">// same as num = num / 4</span></a>
<a class="sourceLine" id="cb11-5" title="5">num <span class="op">*=</span> <span class="dv">7</span><span class="op">;</span> <span class="co">// same as num = num * 7</span></a></code></pre>
</div>
<ul>
<li>
<p>In general, any nonsensical arithmetic will result in <strong>NaN</strong> ; usually operations that
include undefined.</p>
</li>
<li><strong>declaration</strong> : process of simply introducing a variable name.</li>
<li>
<p><strong>initialization</strong> : process of both declaring and assigning a variable on the same line.
</p>
</li>
</ul>
<hr>
<h2 id="functions"><strong>Functions</strong></h2>
<p>A function is a procedure of code that will run when called. Functions are used so that we do not have to
rewrite code to do the same thing over and over. (Think of them as ‘subprograms’)</p>
<ul>
<li><strong>Function Declaration</strong> : Process when we first initially write our function.
<ul>
<li>Includes three things:
<ul>
<li>Name of the function.</li>
<li>A list of <em>parameters</em> ()</li>
<li>The code to execute {}</li>
</ul>
</li>
</ul>
</li>
<li><strong>Function Calls</strong> : We can call upon our function whenever and wherever* we want. (*wherever
is only after the initial declaration)
<ul>
<li>JS evaluates code top down, left to right.</li>
<li>When we execute a declared function later on in our program we refer to this as
<strong>invoking</strong> our function.</li>
<li>Every function in JS returns undefined unless otherwise specified.</li>
<li>When we hit a <strong>return</strong> statement in a function we immediately exit the function and
return to where we called the function.</li>
</ul>
</li>
<li>When naming functions in JS always use camelCase and name it something appropriate. > Greate code reads
like English and almost explains itself. Think: Elegant, readable, and maintainable!</li>
</ul>
<hr>
<h2 id="parameters-and-arguments"><strong>Parameters and Arguments</strong></h2>
<ul>
<li><strong>Parameters</strong> : Comma seperated variables specified as part of a function’s declaration.
</li>
<li>
<p><strong>Arguments</strong> : Values passed to the function when it is invoked.</p>
</li>
<li><em>If the number of arguments passed during a function invocation is different than the number of
paramters listed, it will still work.</em></li>
<li>
<p>However, is there are not enough arguments provided for parameters our function will likely yield
<strong>Nan</strong>.</p>
</li>
</ul>
<hr>
<form id="gclp-frame-form" target="gclp-frame" method="post" style="display: none;"></form>
<div class="gclp-code-grabber" data-gclp-id="0" data-hasqtip="true"
style="left: 874.994px; top: 1209.46px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="1" data-hasqtip="true"
style="left: 874.994px; top: 1432.73px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="2" data-hasqtip="true"
style="left: 874.994px; top: 1548.6px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="3" data-hasqtip="true"
style="left: 874.994px; top: 1671.59px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="4" data-hasqtip="true"
style="left: 874.994px; top: 1839.03px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="5" data-hasqtip="true"
style="left: 875.994px; top: 2153.32px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="6" data-hasqtip="true"
style="left: 874.994px; top: 2559.37px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="7" data-hasqtip="true"
style="left: 874.994px; top: 2728.78px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="8" data-hasqtip="true"
style="left: 874.994px; top: 3363.32px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="9" data-hasqtip="true"
style="left: 874.994px; top: 3485.32px; display: none;"></div>
<div class="gclp-code-grabber" data-gclp-id="10" data-hasqtip="true"
style="left: 875.994px; top: 3654.92px; display: none;"></div><span
style="margin: 0px auto; border: 2px dotted rgb(0, 0, 0); position: absolute; z-index: 2147483647; visibility: hidden; left: 1024px; width: 0px; top: 3258px; height: 0px;"></span><span
style="z-index: 2147483647; position: absolute; visibility: hidden; left: 1009px; width: 50px; top: 3243px; height: 20px; font-size: 10px; color: black;"></span>
<h2 id="deployment">
<a target="_blank" rel="noopener noreferrer"
href="https://60637489113cfe1345c7fcf9--jolly-shannon-bbcd09.netlify.app/">deployment</a>
</h2>
<p>0.) Links:</p>
<table>
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Name</th>
<th style="text-align: left;">Hyperlink</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">OKTA</td>
<td style="text-align: left;">
<a
href="https://lambdaschoolsso.okta.com/login/login.htm?fromURI=%2Fapp%2FUserHome">https://lambdaschoolsso.okta.com/login/login.htm?fromURI=%2Fapp%2FUserHome</a>
</td>
</tr>
<tr class="even">
<td style="text-align: left;">Calendar</td>
<td style="text-align: left;">
<a
href="https://calendar.google.com/calendar/u/0/[email protected]">https://calendar.google.com/calendar/u/0/[email protected]</a>
</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Slack</td>
<td style="text-align: left;">
<a
href="https://app.slack.com/client/T4JUEB3ME/G01QG65CN75">https://app.slack.com/client/T4JUEB3ME/G01QG65CN75</a>
</td>
</tr>
<tr class="even">
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Prep Work</td>
<td style="text-align: left;">
<a href="https://apply.lambdaschool.com/courses/web/">https://apply.lambdaschool.com/courses/web/</a>
</td>
</tr>
</tbody>
</table>
<p>1.) Platforms we need while attending class:</p>
<p>2.) Web Development Software:</p>
<p>3.) Pre-Course Work</p>
<body for="html-export">
<div class="mume markdown-preview ">
<h1 class="mume-header" id="prep-work">Prep-Work</h1>
<h2 class="mume-header" id="deploymenthttps60637489113cfe1345c7fcf9-jolly-shannon-bbcd09netlifyapp"><a
href="https://60637489113cfe1345c7fcf9--jolly-shannon-bbcd09.netlify.app/">deployment</a></h2>
<p>0.) Links:</p>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Hyperlink</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">OKTA</td>
<td style="text-align:left"><a
href="https://lambdaschoolsso.okta.com/login/login.htm?fromURI=%2Fapp%2FUserHome">https://lambdaschoolsso.okta.com/login/login.htm?fromURI=%2Fapp%2FUserHome</a>
</td>
</tr>
<tr>
<td style="text-align:left">Calendar</td>
<td style="text-align:left"><a
href="https://calendar.google.com/calendar/u/0/[email protected]">https://calendar.google.com/calendar/u/0/[email protected]</a>
</td>
</tr>
<tr>
<td style="text-align:left">Slack</td>
<td style="text-align:left"><a
href="https://app.slack.com/client/T4JUEB3ME/G01QG65CN75">https://app.slack.com/client/T4JUEB3ME/G01QG65CN75</a>
</td>
</tr>
<tr>
<td style="text-align:left" colspan="2"></td>
</tr>
<tr>
<td style="text-align:left" colspan="2"></td>
</tr>
<tr>
<td style="text-align:left" colspan="2"></td>
</tr>
<tr>
<td style="text-align:left" colspan="2"></td>
</tr>
<tr>
<td style="text-align:left" colspan="2"></td>
</tr>
<tr>
<td style="text-align:left">Prep Work</td>
<td style="text-align:left"><a
href="https://apply.lambdaschool.com/courses/web/">https://apply.lambdaschool.com/courses/web/</a>
</td>
</tr>
</tbody>
</table>
<p>1.) Platforms we need while attending class:</p>
<p>2.) Web Development Software:</p>
<p>3.) Pre-Course Work</p>
<pre data-role="codeBlock" data-info="" class="language-"><code>.
├── README.html
├── README.md
├── SUMMARY.html
├── SUMMARY.md
├── codeswing.json
├── comparison.png
├── demo.html
├── directory.html
├── index.html
├── javascript-practice
│ ├── 00_expressions_variables
│ │ ├── exercises
│ │ │ ├── A_executing_code_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── B_expressions_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── C_variables_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── D_string_indexing_and_methods_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │
│ │ ├──
│ │ └── solutions
│ │ ├── A_executing_code_solution
│ │ │ ├── age.js
│ │ │ ├── greeting.js
│ │ │ ├──
│ │ │ ├── thirsty.js
│ │ │ └── whoami.js
│ │ ├── B_expressions_solution
│ │ │ ├── boolean-expressions.js
│ │ │ ├── comparisons.js
│ │ │ ├── number-expressions.js
│ │ │ ├──
│ │ │ └── string-expressions.js
│ │ ├── C_variables_solution
│ │ │ ├── four.js
│ │ │ ├── one.js
│ │ │ ├──
│ │ │ ├── three.js
│ │ │ ├── two.js
│ │ │ └── zero.js
│ │ ├── D_string_indexing_and_methods_solution
│ │ │ ├── a-tedious-task.js
│ │ │ ├── dare-to-decipher.js
│ │ │ ├── proper-patterns.js
│ │ │ ├──
│ │ │ └── small-string-snippets.js
│ │
│ ├── 01_conditionals
│ │ ├── exercises
│ │ │ ├── A_conditionals_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │
│ │ ├──
│ │ └── solutions
│ │ ├── A_conditionals_solution
│ │ │ ├── one.js
│ │ │ ├──
│ │ │ ├── three.js
│ │ │ ├── two.js
│ │ │ └── zero.js
│ │
│ ├── 02_functions
│ │ ├── exercises
│ │ │ ├── A_functions_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── B_functions_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── C_functions_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │
│ │ ├──
│ │ └── solutions
│ │ ├── A_functions_solution
│ │ │ ├── average.js
│ │ │ ├── ends-with-t.js
│ │ │ ├── half.js
│ │ │ ├── is-div-by-4.js
│ │ │ ├── is-long.js
│ │ │ ├── keep-it-quiet.js
│ │ │ ├──
│ │ │ ├── snippet-0-1.js
│ │ │ ├── snippet-0-2.js
│ │ │ ├── snippet-0-3.js
│ │ │ └── snippet-0-4.js
│ │ ├── B_functions_solution
│ │ │ ├── ends-in-ly.js
│ │ │ ├── funny-sound.js
│ │ │ ├── longer.js
│ │ │ ├── one-or-none.js
│ │ │ ├── parity.js
│ │ │ ├──
│ │ │ ├── starts-with-r.js
│ │ │ ├── string-size.js
│ │ │ └── wacky-word.js
│ │ ├── C_functions_solution
│ │ │ ├── average-of-four.js
│ │ │ ├── case-changer.js
│ │ │ ├── contains.js
│ │ │ ├── divisible.js
│ │ │ ├── in-range.js
│ │ │ ├── larger.js
│ │ │ ├── number-change.js
│ │ │
│ │
│ ├── 03_loops
│ │ ├── exercises
│ │ │ ├── A_loops_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── B_loops_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── C_loops_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │
│ │ ├──
│ │ └── solutions
│ │ ├── A_loops_solution
│ │ │ ├── count-up.js
│ │ │ ├── evens.js
│ │ │ ├── min-to-max.js
│ │ │ ├── one-to-four.js
│ │ │ ├──
│ │ │ ├── snippet-1.js
│ │ │ ├── snippet-2.js
│ │ │ ├── snippet-3.js
│ │ │ ├── snippet-4.js
│ │ │ ├── snippet-5.js
│ │ │ └── string-iterate.js
│ │ ├── B_loops_solution
│ │ │ ├── div-by-either.js
│ │ │ ├── five-multiples-of.js
│ │ │ ├── no-ohs.js
│ │ │ ├── odd-sum.js
│ │ │ ├── product-up-to.js
│ │ │ ├──
│ │ │ ├── string-repeater.js
│ │ │ └── sum-up-to.js
│ │ ├── C_loops_solution
│ │ │ ├── censor-e.js
│ │ │ ├── divisible-range.js
│ │ │ ├── fizz-buzz.js
│ │ │ ├── raise-power.js
│ │ │ ├── remove-capitals.js
│ │ │ ├── reverse-iterate.js
│ │ │
│ │
│ ├── 04_arrays
│ │ ├── exercises
│ │ │ ├── A_arrays_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── B_arrays_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── C_arrays_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │
│ │ ├──
│ │ └── solutions
│ │ ├── A_arrays_solution
│ │ │ ├── bleep-vowels.js
│ │ │ ├── divisors.js
│ │ │ ├── filter-long-words.js
│ │ │ ├── num-odds.js
│ │ │ ├──
│ │ │ ├── stay-positive.js
│ │ │ ├── strings-to-lengths.js
│ │ │ └── total.js
│ │ ├── B_arrays_solution
│ │ │ ├── choose-divisibles.js
│ │ │ ├── make-acronym.js
│ │ │ ├── maximum.js
│ │ │ ├── reverse-array.js
│ │ │ ├──
│ │ │ ├── word-count.js
│ │ │ └── your-average-function.js
│ │ ├── C_arrays_solution
│ │ │ ├── alternating-caps.js
│ │ │ ├── common-elements.js
│ │ │ ├── lengthiest-word.js
│ │ │ ├── number-range.js
│ │ │ ├── remove-short-words.js
│ │ │
│ │
│ ├── 05_nesting
│ │ ├── exercises
│ │ │ ├── A_nested_loops_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── B_two_dimensional_arrays_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │ ├── C_more_problems_exercise
│ │ │ │ ├── README.html
│ │ │ │ ├── README.md
│ │ │ │
│ │ │
│ │ ├──
│ │ └── solutions
│ │ ├── A_nested_loops_solution
│ │ │ ├── pair-print.js
│ │ │ ├── print-combinations.js
│ │ │ ├──
│ │ │ ├── snippet-1.js
│ │ │ ├── snippet-2.js
│ │ │ ├── snippet-3.js
│ │ │ ├── snippet-4.js
│ │ │ ├── snippet-5.js
│ │ │ └── two-sum.js
│ │ ├── B_two_dimensional_arrays_solution
│ │ │ ├── make-matrix.js
│ │ │ ├── print-2d.js
│ │ │ ├──
│ │ │ ├── total-product.js
│ │ │ ├── two-sum-pairs.js
│ │ │ └── zipper.js
│ │ ├── C_more_problems_solution
│ │ │ ├── remove-dupes.js
│ │ │ ├── remove-first-vowel.js
│ │ │ ├── remove-vowels.js
│ │ │ ├──
│ │ │ ├── shorten-long-words.js
│ │ │ └── spam.js
│ │
│ ├── 06_decomposition_pattern
│ │ ├── A_decomposing_problems_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │ ├── B_decomposing_problems_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │ ├── C_decomposing_problems_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │
│ ├── 07_objects
│ │ ├── A_objects_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │ ├── B_objects_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │ ├── C_objects_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │
│ ├── 08_higher_order_functions
│ │ ├── A_native_callback_methods_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │ ├── B_native_callback_methods_exercise
│ │ │ ├── README.html
│ │ │ ├── README.md
│ │ │
│ │
│
├── js.js
├── one-of-every-tag.html
├── readme
│ ├── README.html
│ ├── README_files
│ │ ├── katex.min.css
│ │
│
├── resources.html
├── resources.md
├── script.js
├── style.css
└── tree.md
66 directories, 241 files
</code></pre>
<h1 class="mume-header undefined" id="week-1brintroduction-to-javascript-part-1">WEEK 1<br><em>Introduction
to JavaScript (Part 1)</em></h1>
<hr>
<p><a href="#expression-learning-objectives"><strong>Expression Learning Objectives</strong></a><br>
<a href="#intro-to-functions-learning-objectives"><strong>Intro to Functions Learning
Objectives</strong></a></p>
<ul>
<li><a href="#hello-world">Hello World</a>
<ul>
<li><a href="#getting-visual-feedback-in-your-programs">Getting visual feedback in your programs</a>
</li>
<li><a href="#code-comments">Code comments</a></li>
</ul>
</li>
<li><a href="#the-number-type">The Number Type</a>
<ul>
<li><a href="#all-the-numbers">All the numbers</a></li>
<li><a href="#the-basic-arithmetic-operators">The basic arithmetic operators</a></li>
</ul>
</li>
<li><a href="#the-string-type">The String Type</a>
<ul>
<li><a href="#writing-a-valid-string">Writing a valid string</a></li>
<li><a href="#calculating-length">Calculating length</a></li>
<li><a href="#indexing-a-string">Indexing a string</a></li>
<li><a href="#concatenation">Concatenation</a></li>
</ul>
</li>
<li><a href="#the-boolean-type">The Boolean Type</a>
<ul>
<li><a href="#logical-operators">Logical Operators</a></li>
<li><a href="#de-morgans-law">De Morgan's Law</a></li>
</ul>
</li>
<li><a href="#comparison-operators">Comparison Operators</a>
<ul>
<li><a href="#the-relative-comparators">The relative comparators</a></li>
<li><a href="#vs">=== vs ==</a></li>
</ul>
</li>
<li><a href="#basic-variables">Basic Variables</a>
<ul>
<li><a href="#initializing-a-variable">Initializing a variable</a></li>
<li><a href="#manipulating-variables">Manipulating variables</a></li>
<li><a href="#nan">NaN</a></li>
</ul>
</li>
<li><a href="#introduction-to-functions">Introduction to Functions</a>
<ul>
<li><a href="#writing-functions">Writing Functions</a></li>
<li><a href="#invoking-or-calling-a-function">Invoking or "calling" a function</a></li>
<li><a href="#returning-a-value">Returning a value</a></li>
<li><a href="#the-importance-of-naming">The importance of naming</a></li>
</ul>
</li>
<li><a href="#parameters-and-arguments">Parameters and Arguments</a>
<ul>
<li><a href="#the-difference-between-parameters-and-arguments">The difference between Parameters and
Arguments</a></li>
</ul>
</li>
</ul>
<p><a href="#control-flow-and-array-learning-objectives"><strong>Control Flow and Array Learning
Objectives</strong></a></p>
<ul>
<li><a href="#control-flow-conditional-statements">Control Flow - Conditional Statements</a>
<ul>
<li><a href="#a-quick-word-on-syntax">A Quick Word on Syntax</a></li>
<li><a href="#writing-conditional-statements">Writing Conditional Statements</a></li>
</ul>
</li>
<li><a href="#mutually-exclusive-conditions">Mutually Exclusive Conditions</a>
<ul>
<li><a href="#when-to-use-if-statements">When to use if statements</a></li>
</ul>
</li>
<li><a href="#control-flow-looping">Control Flow - Looping</a>
<ul>
<li><a href="#looping">Looping</a></li>
<li><a href="#translating-from-one-loop-to-another">Translating From One Loop to Another</a></li>
</ul>
</li>
<li><a href="#the-array-type">The Array Type</a>
<ul>
<li><a href="#using-arrays">Using arrays</a></li>
<li><a href="#indexing-arrays">Indexing arrays</a></li>
<li><a href="#working-with-arrays">Working with arrays</a></li>
<li><a href="#concatenation-with-arrays">Concatenation with arrays</a></li>
</ul>
</li>
</ul>
<p><a href="#intermediate-functions-learning-objectives"><strong>Intermediate Functions Learning
Objectives</strong></a></p>
<ul>
<li><a href="#function-expressions">Function Expressions</a>
<ul>
<li><a href="#functions-as-first-class-objects">Functions as first-class objects</a></li>
</ul>
</li>
<li><a href="#two-dimensional-arrays-2d-arrays">Two-Dimensional Arrays (2D Arrays)</a>