WEBVTT

1
00:00:05.925 --> 00:00:06.985
<00:00:05.925>Ladies <00:00:06.402>and <00:00:06.879>gentlemen

2
00:00:06.985 --> 00:00:09.025
<00:00:06.985>and <00:00:07.265>my <00:00:07.545>dearest <00:00:07.825>non-binary <00:00:08.105>nerd, <00:00:08.385>welcome

3
00:00:09.165 --> 00:00:11.065
<00:00:09.165>to <00:00:09.514>Best <00:00:09.864>of <00:00:10.215>the <00:00:10.565>Worst.

4
00:00:12.165 --> 00:00:15.825
<00:00:12.165>Hi, <00:00:12.364>I'm <00:00:12.565>Peter <00:00:12.764>and <00:00:12.965>I <00:00:13.165>basically <00:00:13.364>do <00:00:13.565>workshops

5
00:00:15.825 --> 00:00:17.345
<00:00:15.825>and <00:00:16.166>trainings <00:00:16.509>on <00:00:16.851>web <00:00:17.192>technology,

6
00:00:17.645 --> 00:00:19.945
<00:00:17.645>but <00:00:17.820>the <00:00:17.995>good <00:00:18.169>web <00:00:18.345>technology, <00:00:18.520>not <00:00:18.695>the <00:00:18.870>framework <00:00:19.044>garbage

7
00:00:19.945 --> 00:00:22.265
<00:00:19.945>that <00:00:20.145>everybody <00:00:20.345>tries <00:00:20.545>to <00:00:20.745>shove <00:00:20.945>down <00:00:21.145>our <00:00:21.345>throats.

8
00:00:22.485 --> 00:00:25.145
<00:00:22.485>No, <00:00:22.625>I'm <00:00:22.765>all <00:00:22.905>about <00:00:23.044>the <00:00:23.185>real <00:00:23.325>deal, <00:00:23.465>the <00:00:23.605>low <00:00:23.744>level <00:00:23.884>stuff,

9
00:00:25.145 --> 00:00:27.225
<00:00:25.145>the <00:00:25.425>HTML, <00:00:25.705>the <00:00:25.985>JavaScript, <00:00:26.265>the <00:00:26.544>TypeScript.

10
00:00:27.645 --> 00:00:31.305
<00:00:27.645>So <00:00:27.820>you <00:00:27.995>might <00:00:28.169>say <00:00:28.345>that <00:00:28.520>I <00:00:28.695>make <00:00:28.870>developers <00:00:29.044>smarter.

11
00:00:31.735 --> 00:00:33.505
<00:00:31.735>Usually <00:00:32.085>that's <00:00:32.435>my <00:00:32.785>day <00:00:33.135>job,

12
00:00:34.045 --> 00:00:36.785
<00:00:34.045>but <00:00:34.220>unfortunately <00:00:34.395>today <00:00:34.570>is <00:00:34.745>not <00:00:34.920>every <00:00:35.095>other <00:00:35.270>day, <00:00:35.445>right?

13
00:00:37.165 --> 00:00:38.385
<00:00:37.165>So <00:00:37.714>we <00:00:38.263>instead

14
00:00:38.385 --> 00:00:40.625
<00:00:38.385>of <00:00:38.559>learning <00:00:38.735>the <00:00:38.910>good <00:00:39.085>bits <00:00:39.260>about <00:00:39.434>JavaScript <00:00:39.610>are <00:00:39.785>going

15
00:00:40.625 --> 00:00:42.745
<00:00:40.625>to <00:00:40.800>talk <00:00:40.975>about <00:00:41.150>the <00:00:41.325>bad <00:00:41.500>bits <00:00:41.675>about <00:00:41.850>in <00:00:42.025>JavaScript.

16
00:00:43.285 --> 00:00:46.185
<00:00:43.285>Now <00:00:43.565>what <00:00:43.845>qualifies <00:00:44.125>as <00:00:44.404>bad <00:00:44.684>JavaScript?

17
00:00:46.535 --> 00:00:48.305
<00:00:46.535>Well, <00:00:46.709>it <00:00:46.885>depends <00:00:47.059>on <00:00:47.235>how <00:00:47.410>on <00:00:47.584>who <00:00:47.760>you <00:00:47.934>ask,

18
00:00:48.405 --> 00:00:50.745
<00:00:48.405>but <00:00:48.638>um, <00:00:48.871>classics <00:00:49.105>of <00:00:49.338>the <00:00:49.571>genre <00:00:49.805>of

19
00:00:51.085 --> 00:00:53.145
<00:00:51.085>of <00:00:51.285>course <00:00:51.485>include <00:00:51.685>messing <00:00:51.885>with <00:00:52.085>a <00:00:52.285>type <00:00:52.485>system.

20
00:00:53.205 --> 00:00:54.385
<00:00:53.205>You've <00:00:53.559>probably <00:00:53.913>seen <00:00:54.266>this.

21
00:00:54.565 --> 00:00:57.385
<00:00:54.565>If <00:00:54.692>you <00:00:54.819>take <00:00:54.946>a <00:00:55.074>string <00:00:55.201>sub, <00:00:55.328>subtract <00:00:55.455>a <00:00:55.583>number <00:00:55.710>from <00:00:55.837>the <00:00:55.964>string,

22
00:00:57.525 --> 00:01:00.665
<00:00:57.525>you <00:00:57.665>get <00:00:57.805>back, <00:00:57.945>not <00:00:58.085>a <00:00:58.225>number <00:00:58.364>chain <00:00:58.504>together, <00:00:58.644>a <00:00:58.785>whole <00:00:58.925>bunch

23
00:01:00.665 --> 00:01:02.225
<00:01:00.665>of <00:01:00.945>NTO <00:01:01.225>numbers, <00:01:01.504>a <00:01:01.785>pen <00:01:02.065>Batman,

24
00:01:02.245 --> 00:01:04.945
<00:01:02.245>and <00:01:02.419>you'll <00:01:02.595>get <00:01:02.769>the <00:01:02.945>Batman <00:01:03.120>theme <00:01:03.294>song, <00:01:03.470>ha <00:01:03.644>ha.

25
00:01:05.375 --> 00:01:07.465
<00:01:05.375>This <00:01:05.530>is <00:01:05.686>just <00:01:05.841>your <00:01:05.997>basic <00:01:06.152>dunking <00:01:06.308>on <00:01:06.463>the <00:01:06.619>type <00:01:06.775>system.

26
00:01:07.685 --> 00:01:10.065
<00:01:07.685>But <00:01:07.840>this <00:01:07.996>is <00:01:08.151>actually <00:01:08.307>rather <00:01:08.462>boring <00:01:08.618>if <00:01:08.773>you <00:01:08.929>ask <00:01:09.085>me,

27
00:01:10.065 --> 00:01:13.145
<00:01:10.065>because <00:01:10.220>you <00:01:10.376>don't <00:01:10.531>write <00:01:10.687>this, <00:01:10.842>you <00:01:10.998>will <00:01:11.153>never <00:01:11.309>write <00:01:11.465>this.

28
00:01:13.145 --> 00:01:16.225
<00:01:13.145>This <00:01:13.285>is <00:01:13.425>just <00:01:13.565>a <00:01:13.705>classic <00:01:13.845>case <00:01:13.985>of <00:01:14.125>garbage <00:01:14.265>in, <00:01:14.405>garbage <00:01:14.545>out.

29
00:01:16.725 --> 00:01:18.825
<00:01:16.725>Um, <00:01:16.925>and <00:01:17.125>especially <00:01:17.324>if <00:01:17.524>you <00:01:17.725>use <00:01:17.925>tabs <00:01:18.125>script,

30
00:01:18.825 --> 00:01:20.225
<00:01:18.825>this <00:01:19.005>is <00:01:19.185>not <00:01:19.365>going <00:01:19.545>to <00:01:19.725>happen <00:01:19.905>to <00:01:20.085>you.

31
00:01:20.415 --> 00:01:24.705
<00:01:20.414>There's <00:01:20.554>no <00:01:20.695>usefulness <00:01:20.835>in <00:01:20.975>this. <00:01:21.115>So <00:01:21.255>this <00:01:21.395>is <00:01:21.535>all <00:01:21.675>just <00:01:21.815>boring.

32
00:01:25.045 --> 00:01:26.945
<00:01:25.045>I'm <00:01:25.325>more <00:01:25.605>after <00:01:25.885>the <00:01:26.165>more <00:01:26.445>interesting

33
00:01:26.965 --> 00:01:30.625
<00:01:26.965>and <00:01:27.140>more <00:01:27.315>maybe <00:01:27.490>sometimes <00:01:27.665>useful <00:01:27.840>kind <00:01:28.015>of <00:01:28.190>bad <00:01:28.365>features.

34
00:01:30.965 --> 00:01:32.945
<00:01:30.965>And <00:01:31.245>to <00:01:31.525>make <00:01:31.805>this <00:01:32.085>all <00:01:32.365>understandable

35
00:01:33.125 --> 00:01:35.425
<00:01:33.125>to <00:01:33.265>our <00:01:33.405>internet <00:01:33.545>adult <00:01:33.685>minds, <00:01:33.825>we <00:01:33.965>will <00:01:34.105>take <00:01:34.245>a <00:01:34.385>whole <00:01:34.525>bunch

36
00:01:35.665 --> 00:01:38.505
<00:01:35.664>of <00:01:35.839>bad <00:01:36.014>features <00:01:36.190>and <00:01:36.365>sort <00:01:36.539>them <00:01:36.714>into <00:01:36.889>your <00:01:37.065>classical

37
00:01:38.705 --> 00:01:39.825
<00:01:38.705>internet <00:01:39.041>compatible <00:01:39.377>tier <00:01:39.713>list.

38
00:01:39.845 --> 00:01:42.905
<00:01:39.845>Of <00:01:40.020>course, <00:01:40.195>this <00:01:40.370>will <00:01:40.545>help <00:01:40.720>us <00:01:40.895>to <00:01:41.070>keep <00:01:41.245>track

39
00:01:42.925 --> 00:01:43.985
<00:01:42.925>of <00:01:43.163>all <00:01:43.402>the <00:01:43.640>bad <00:01:43.879>features

40
00:01:43.985 --> 00:01:46.305
<00:01:43.985>that <00:01:44.218>we <00:01:44.451>will <00:01:44.685>encounter <00:01:44.918>in <00:01:45.151>this <00:01:45.385>presentation.

41
00:01:46.445 --> 00:01:48.065
<00:01:46.445>So <00:01:46.794>let's <00:01:47.145>dive <00:01:47.494>right <00:01:47.845>in.

42
00:01:48.225 --> 00:01:51.945
<00:01:48.225>Starting <00:01:48.425>with <00:01:48.625>something <00:01:48.824>rather <00:01:49.024>simple <00:01:49.225>like <00:01:49.425>bullions <00:01:49.625>yoga.

43
00:01:52.115 --> 00:01:54.665
<00:01:52.115>Basic <00:01:52.290>bullion <00:01:52.465>is <00:01:52.640>you <00:01:52.815>write <00:01:52.990>through, <00:01:53.165>you <00:01:53.340>write <00:01:53.515>faults,

44
00:01:54.665 --> 00:01:57.305
<00:01:54.664>you <00:01:54.792>get <00:01:54.919>like <00:01:55.046>a <00:01:55.174>bullion <00:01:55.301>value <00:01:55.428>and <00:01:55.555>this <00:01:55.683>will <00:01:55.810>work <00:01:55.937>just <00:01:56.065>fine,

45
00:01:57.565 --> 00:01:59.425
<00:01:57.565>but <00:01:57.765>you <00:01:57.965>can <00:01:58.164>also <00:01:58.365>take <00:01:58.565>a <00:01:58.765>bullion <00:01:58.965>value

46
00:01:59.685 --> 00:02:02.345
<00:01:59.685>and <00:01:59.840>wrap <00:01:59.996>it <00:02:00.151>in <00:02:00.307>an <00:02:00.462>object <00:02:00.618>using <00:02:00.773>the <00:02:00.929>bullion <00:02:01.085>structor.

47
00:02:02.965 --> 00:02:04.265
<00:02:02.965>Now <00:02:03.199>why <00:02:03.433>would <00:02:03.667>you <00:02:03.901>do <00:02:04.135>this?

48
00:02:04.895 --> 00:02:06.465
<00:02:04.895>Well, <00:02:05.361>essentially <00:02:05.828>you <00:02:06.295>wouldn't,

49
00:02:06.735 --> 00:02:07.985
<00:02:06.735>this <00:02:06.960>is <00:02:07.185>not <00:02:07.410>good <00:02:07.635>for <00:02:07.860>anything.

50
00:02:08.285 --> 00:02:11.385
<00:02:08.285>All <00:02:08.440>this <00:02:08.596>gives <00:02:08.751>you <00:02:08.907>is <00:02:09.062>essentially <00:02:09.218>an <00:02:09.373>object <00:02:09.529>containing <00:02:09.685>a

51
00:02:11.385 --> 00:02:13.345
<00:02:11.385>single <00:02:11.734>method <00:02:12.084>called <00:02:12.435>value <00:02:12.785>off

52
00:02:13.455 --> 00:02:15.545
<00:02:13.455>that <00:02:13.655>when <00:02:13.855>called <00:02:14.055>gives <00:02:14.255>you <00:02:14.455>back <00:02:14.655>the <00:02:14.855>bullion.

53
00:02:15.725 --> 00:02:17.865
<00:02:15.725>But <00:02:15.924>apart <00:02:16.125>from, <00:02:16.325>you <00:02:16.525>know, <00:02:16.725>just <00:02:16.924>writing <00:02:17.125>true

54
00:02:17.865 --> 00:02:20.625
<00:02:17.865>or <00:02:18.040>false, <00:02:18.215>this <00:02:18.390>is <00:02:18.565>longer, <00:02:18.740>this <00:02:18.915>is <00:02:19.090>more <00:02:19.265>tokens.

55
00:02:20.725 --> 00:02:22.665
<00:02:20.725>If <00:02:20.924>you <00:02:21.125>get <00:02:21.325>paid <00:02:21.525>by <00:02:21.725>the <00:02:21.924>token, <00:02:22.125>which

56
00:02:22.765 --> 00:02:25.385
<00:02:22.765>as <00:02:22.904>I've <00:02:23.045>heard <00:02:23.184>today <00:02:23.325>many <00:02:23.464>times <00:02:23.605>is <00:02:23.744>all <00:02:23.885>the <00:02:24.024>rage <00:02:24.165>nowadays.

57
00:02:25.805 --> 00:02:28.465
<00:02:25.805>Um, <00:02:25.980>you <00:02:26.155>can, <00:02:26.330>you <00:02:26.505>know, <00:02:26.680>get <00:02:26.855>by <00:02:27.030>with <00:02:27.205>this

58
00:02:28.485 --> 00:02:30.625
<00:02:28.485>and <00:02:28.640>it <00:02:28.796>even <00:02:28.951>appears <00:02:29.107>to <00:02:29.262>work <00:02:29.418>on <00:02:29.573>the <00:02:29.729>surface, <00:02:29.885>right?

59
00:02:30.845 --> 00:02:33.385
<00:02:30.845>You <00:02:30.984>can <00:02:31.125>take <00:02:31.265>this <00:02:31.405>guy, <00:02:31.545>shove <00:02:31.685>him <00:02:31.825>into <00:02:31.965>an <00:02:32.105>if <00:02:32.245>statement

60
00:02:33.645 --> 00:02:35.025
<00:02:33.645>and <00:02:33.955>then <00:02:34.266>your <00:02:34.576>code <00:02:34.887>executes.

61
00:02:35.165 --> 00:02:37.945
<00:02:35.165>But <00:02:35.304>the <00:02:35.445>problem <00:02:35.584>with <00:02:35.725>this <00:02:35.864>is <00:02:36.005>this <00:02:36.144>is <00:02:36.285>still <00:02:36.424>an <00:02:36.565>object.

62
00:02:37.945 --> 00:02:38.945
<00:02:37.945>This <00:02:38.170>is <00:02:38.394>not <00:02:38.620>a <00:02:38.845>bullion.

63
00:02:39.045 --> 00:02:41.065
<00:02:39.045>If <00:02:39.185>you <00:02:39.325>take <00:02:39.465>a <00:02:39.605>look <00:02:39.745>at <00:02:39.885>the <00:02:40.025>type, <00:02:40.165>it's <00:02:40.305>an <00:02:40.445>object.

64
00:02:41.205 --> 00:02:42.945
<00:02:41.204>And <00:02:41.438>what <00:02:41.671>do <00:02:41.904>you <00:02:42.138>know <00:02:42.371>about <00:02:42.605>objects?

65
00:02:42.975 --> 00:02:45.465
<00:02:42.975>Well, <00:02:43.130>if <00:02:43.286>you <00:02:43.441>want <00:02:43.597>to <00:02:43.752>dunk <00:02:43.908>on <00:02:44.063>the <00:02:44.219>type <00:02:44.375>system,

66
00:02:45.465 --> 00:02:48.225
<00:02:45.465>you <00:02:45.620>can <00:02:45.776>point <00:02:45.931>out <00:02:46.087>that <00:02:46.242>objects <00:02:46.398>always <00:02:46.553>coerce <00:02:46.709>to <00:02:46.865>true,

67
00:02:48.375 --> 00:02:51.585
<00:02:48.375>meaning <00:02:48.515>you <00:02:48.655>take <00:02:48.795>a <00:02:48.935>fault, <00:02:49.075>wrap <00:02:49.215>it <00:02:49.355>into <00:02:49.495>a <00:02:49.635>bullion <00:02:49.775>object

68
00:02:51.605 --> 00:02:53.065
<00:02:51.605>and <00:02:51.823>try <00:02:52.043>to <00:02:52.262>do <00:02:52.481>the <00:02:52.700>same <00:02:52.918>thing.

69
00:02:53.215 --> 00:02:54.665
<00:02:53.215>Your <00:02:53.650>code <00:02:54.085>still <00:02:54.519>executes

70
00:02:54.665 --> 00:02:57.105
<00:02:54.665>because <00:02:54.840>even <00:02:55.015>though <00:02:55.190>this <00:02:55.364>is <00:02:55.540>false, <00:02:55.715>it's <00:02:55.890>actually <00:02:56.065>true

71
00:02:57.105 --> 00:02:59.225
<00:02:57.105>because <00:02:57.280>it's <00:02:57.454>an <00:02:57.630>object <00:02:57.804>and <00:02:57.980>this <00:02:58.155>is <00:02:58.329>still <00:02:58.505>JavaScript

72
00:03:00.425 --> 00:03:02.365
<00:03:00.425>and <00:03:00.625>this <00:03:00.825>is <00:03:01.025>how <00:03:01.225>it <00:03:01.425>works <00:03:01.625>with <00:03:01.825>bullions.

73
00:03:02.365 --> 00:03:04.365
<00:03:02.365>You <00:03:02.540>can <00:03:02.715>do <00:03:02.890>the <00:03:03.065>same <00:03:03.240>with <00:03:03.415>strings <00:03:03.590>and <00:03:03.765>numbers.

74
00:03:04.825 --> 00:03:06.765
<00:03:04.825>Uh, <00:03:05.000>you <00:03:05.174>can <00:03:05.350>also <00:03:05.524>do <00:03:05.700>this <00:03:05.875>with <00:03:06.049>big <00:03:06.225>end

75
00:03:06.765 --> 00:03:08.885
<00:03:06.765>and <00:03:06.964>symbol, <00:03:07.165>even <00:03:07.364>though <00:03:07.565>the <00:03:07.765>constructor <00:03:07.964>functions <00:03:08.165>throw,

76
00:03:09.105 --> 00:03:10.165
<00:03:09.105>but <00:03:09.343>there <00:03:09.582>is <00:03:09.820>a <00:03:10.059>way

77
00:03:10.185 --> 00:03:12.605
<00:03:10.185>to <00:03:10.385>create <00:03:10.585>symbol <00:03:10.785>wrappers <00:03:10.985>and <00:03:11.185>big <00:03:11.385>end <00:03:11.585>wrappers.

78
00:03:12.745 --> 00:03:13.965
<00:03:12.745>Um, <00:03:12.901>but <00:03:13.058>I <00:03:13.215>don't <00:03:13.372>have <00:03:13.529>time <00:03:13.686>for <00:03:13.843>this,

79
00:03:13.985 --> 00:03:15.645
<00:03:13.985>so <00:03:14.185>we <00:03:14.385>will <00:03:14.585>just <00:03:14.785>skip <00:03:14.985>right <00:03:15.185>over <00:03:15.385>this.

80
00:03:16.105 --> 00:03:18.925
<00:03:16.105>You've <00:03:16.304>already, <00:03:16.505>you've <00:03:16.704>always <00:03:16.905>have <00:03:17.105>an <00:03:17.304>object <00:03:17.505>variant

81
00:03:18.985 --> 00:03:21.365
<00:03:18.985>of <00:03:19.160>your <00:03:19.335>primitives <00:03:19.510>at <00:03:19.685>your <00:03:19.860>hands, <00:03:20.035>at <00:03:20.210>your <00:03:20.385>disposal.

82
00:03:21.785 --> 00:03:24.045
<00:03:21.785>Is <00:03:22.018>this <00:03:22.251>good <00:03:22.484>for <00:03:22.718>anything? <00:03:22.951>Mostly <00:03:23.185>not.

83
00:03:24.045 --> 00:03:26.685
<00:03:24.045>If <00:03:24.220>you <00:03:24.395>do <00:03:24.570>real <00:03:24.745>development, <00:03:24.920>um, <00:03:25.095>if <00:03:25.270>you <00:03:25.445>don't

84
00:03:26.685 --> 00:03:28.365
<00:03:26.685>or <00:03:26.860>if <00:03:27.035>you <00:03:27.210>are <00:03:27.385>kind <00:03:27.560>of <00:03:27.735>on <00:03:27.910>the <00:03:28.085>border

85
00:03:28.505 --> 00:03:31.605
<00:03:28.505>of <00:03:28.660>doing <00:03:28.816>real <00:03:28.971>development, <00:03:29.127>then <00:03:29.282>maybe <00:03:29.438>there's <00:03:29.593>some <00:03:29.749>use <00:03:29.905>case.

86
00:03:31.875 --> 00:03:34.525
<00:03:31.875>Back <00:03:32.015>in <00:03:32.155>the <00:03:32.295>day, <00:03:32.435>I <00:03:32.575>was <00:03:32.715>actually <00:03:32.855>working <00:03:32.995>on <00:03:33.135>some <00:03:33.275>sort

87
00:03:34.525 --> 00:03:36.245
<00:03:34.525>of <00:03:34.875>project, <00:03:35.225>let's <00:03:35.575>just <00:03:35.925>say

88
00:03:36.395 --> 00:03:38.965
<00:03:36.395>that <00:03:36.595>was <00:03:36.795>doing <00:03:36.995>proper <00:03:37.195>development, <00:03:37.395>meaning <00:03:37.595>I <00:03:37.795>had

89
00:03:38.965 --> 00:03:41.365
<00:03:38.965>to <00:03:39.120>import <00:03:39.276>a <00:03:39.431>whole <00:03:39.587>bunch <00:03:39.742>of <00:03:39.898>dependencies <00:03:40.053>like <00:03:40.209>this <00:03:40.365>connect

90
00:03:41.605 --> 00:03:43.685
<00:03:41.605>function, <00:03:41.760>which <00:03:41.916>you <00:03:42.071>know, <00:03:42.227>connected <00:03:42.382>to <00:03:42.538>some <00:03:42.693>sort <00:03:42.849>of <00:03:43.005>service.

91
00:03:44.085 --> 00:03:46.205
<00:03:44.085>I <00:03:44.240>don't <00:03:44.396>remember <00:03:44.551>the <00:03:44.707>specifics <00:03:44.862>and <00:03:45.018>I <00:03:45.173>don't <00:03:45.329>really <00:03:45.485>care.

92
00:03:46.555 --> 00:03:48.365
<00:03:46.555>It's <00:03:46.730>a <00:03:46.905>simple <00:03:47.080>function <00:03:47.255>that <00:03:47.430>connects <00:03:47.605>to <00:03:47.780>a <00:03:47.955>server

93
00:03:48.505 --> 00:03:49.685
<00:03:48.505>and <00:03:48.770>that <00:03:49.036>can <00:03:49.301>be <00:03:49.567>configured

94
00:03:49.785 --> 00:03:51.365
<00:03:49.785>by <00:03:49.984>passing <00:03:50.185>in <00:03:50.385>a <00:03:50.585>whole <00:03:50.785>bunch <00:03:50.984>of <00:03:51.185>options.

95
00:03:51.785 --> 00:03:55.205
<00:03:51.785>One <00:03:51.940>of <00:03:52.096>the <00:03:52.251>options <00:03:52.407>was <00:03:52.562>the <00:03:52.718>number <00:03:52.873>of <00:03:53.029>reconnection <00:03:53.185>attempts.

96
00:03:55.305 --> 00:03:57.765
<00:03:55.305>So <00:03:55.445>if <00:03:55.585>the <00:03:55.725>first <00:03:55.865>attempt <00:03:56.005>to <00:03:56.145>connect <00:03:56.285>to <00:03:56.425>the <00:03:56.565>server <00:03:56.705>fails,

97
00:03:57.875 --> 00:04:00.645
<00:03:57.875>this <00:03:58.030>is <00:03:58.186>the <00:03:58.341>number <00:03:58.497>of <00:03:58.652>retry <00:03:58.808>attempts <00:03:58.963>that <00:03:59.119>I <00:03:59.275>want

98
00:04:00.645 --> 00:04:01.965
<00:04:00.645>and <00:04:00.942>it <00:04:01.239>defaults <00:04:01.536>to <00:04:01.833>infinity.

99
00:04:02.145 --> 00:04:04.965
<00:04:02.145>If <00:04:02.300>I <00:04:02.456>don't <00:04:02.611>pass <00:04:02.767>in <00:04:02.922>a <00:04:03.078>number <00:04:03.233>using <00:04:03.389>the <00:04:03.545>bullion

100
00:04:04.985 --> 00:04:08.005
<00:04:04.985>or <00:04:05.160>operator, <00:04:05.335>okay, <00:04:05.510>this <00:04:05.685>is <00:04:05.860>nice, <00:04:06.035>I <00:04:06.210>can <00:04:06.385>connect

101
00:04:08.005 --> 00:04:09.925
<00:04:08.005>to <00:04:08.180>whatever <00:04:08.355>service <00:04:08.530>this <00:04:08.704>was <00:04:08.880>back <00:04:09.055>in <00:04:09.230>the <00:04:09.405>day,

102
00:04:10.145 --> 00:04:12.525
<00:04:10.145>but <00:04:10.320>my <00:04:10.495>use <00:04:10.670>case <00:04:10.845>was <00:04:11.020>a <00:04:11.195>little <00:04:11.370>bit <00:04:11.545>special.

103
00:04:13.205 --> 00:04:16.045
<00:04:13.205>I <00:04:13.380>didn't <00:04:13.555>want <00:04:13.730>any <00:04:13.905>reconnection <00:04:14.080>attempts, <00:04:14.255>I <00:04:14.430>just <00:04:14.605>wanted

104
00:04:16.045 --> 00:04:17.125
<00:04:16.045>to <00:04:16.288>try <00:04:16.531>to <00:04:16.774>connect <00:04:17.017>once

105
00:04:17.305 --> 00:04:20.845
<00:04:17.305>and <00:04:17.460>if <00:04:17.616>this <00:04:17.771>failed <00:04:17.927>fall <00:04:18.082>back <00:04:18.238>to <00:04:18.393>um, <00:04:18.549>uh, <00:04:18.704>offline

106
00:04:20.845 --> 00:04:22.165
<00:04:20.845>and <00:04:21.142>offline, <00:04:21.439>offline <00:04:21.736>only <00:04:22.033>mode.

107
00:04:22.465 --> 00:04:25.605
<00:04:22.465>So <00:04:22.664>what <00:04:22.864>I <00:04:23.065>wanted <00:04:23.265>was <00:04:23.465>zero <00:04:23.664>reconnection <00:04:23.864>attempts,

108
00:04:25.705 --> 00:04:27.085
<00:04:25.705>but <00:04:26.015>by <00:04:26.325>passing <00:04:26.636>in <00:04:26.947>zero,

109
00:04:27.405 --> 00:04:29.285
<00:04:27.405>I <00:04:27.684>actually <00:04:27.965>get <00:04:28.244>infinity <00:04:28.525>reconnection <00:04:28.804>attempts

110
00:04:29.285 --> 00:04:30.845
<00:04:29.285>because <00:04:29.751>again, <00:04:30.218>the <00:04:30.685>bullion

111
00:04:30.845 --> 00:04:33.805
<00:04:30.845>or <00:04:31.000>operator <00:04:31.156>coerces <00:04:31.311>the <00:04:31.467>value <00:04:31.622>on <00:04:31.778>the <00:04:31.933>left <00:04:32.089>hand <00:04:32.245>side

112
00:04:33.865 --> 00:04:35.925
<00:04:33.865>to <00:04:34.098>faults <00:04:34.331>and <00:04:34.565>then <00:04:34.798>I <00:04:35.031>get <00:04:35.265>infinity.

113
00:04:36.585 --> 00:04:39.525
<00:04:36.585>Now <00:04:36.760>how <00:04:36.935>do <00:04:37.109>I <00:04:37.284>get <00:04:37.460>zero <00:04:37.635>into <00:04:37.810>this <00:04:37.984>code?

114
00:04:39.675 --> 00:04:43.245
<00:04:39.675>Well, <00:04:39.815>I <00:04:39.955>need <00:04:40.095>a <00:04:40.235>way, <00:04:40.375>some <00:04:40.515>way <00:04:40.655>to <00:04:40.795>take <00:04:40.935>my <00:04:41.075>zero,

115
00:04:43.555 --> 00:04:46.565
<00:04:43.555>wrap <00:04:43.710>it <00:04:43.866>in <00:04:44.021>something <00:04:44.177>that <00:04:44.332>actually <00:04:44.488>gets <00:04:44.643>past <00:04:44.799>the <00:04:44.955>logical

116
00:04:46.705 --> 00:04:48.365
<00:04:46.705>or <00:04:46.938>operator <00:04:47.171>and <00:04:47.405>wouldn't <00:04:47.638>you <00:04:47.871>know <00:04:48.104>it,

117
00:04:48.365 --> 00:04:49.565
<00:04:48.365>there <00:04:48.545>is <00:04:48.725>a <00:04:48.905>way <00:04:49.085>to <00:04:49.265>do <00:04:49.445>this.

118
00:04:50.845 --> 00:04:53.525
<00:04:50.845>I <00:04:51.045>mean, <00:04:51.245>grownups <00:04:51.445>would <00:04:51.645>probably <00:04:51.845>have, <00:04:52.045>you <00:04:52.245>know,

119
00:04:53.525 --> 00:04:56.125
<00:04:53.525>submitted <00:04:53.724>a <00:04:53.924>pool <00:04:54.125>request, <00:04:54.325>maybe <00:04:54.525>reported <00:04:54.724>the <00:04:54.924>issue,

120
00:04:56.345 --> 00:04:57.725
<00:04:56.345>but <00:04:56.966>I <00:04:57.587>didn't.

121
00:04:57.905 --> 00:05:00.605
<00:04:57.905>And <00:04:58.080>this <00:04:58.255>worked. <00:04:58.429>I <00:04:58.604>mean <00:04:58.780>this <00:04:58.955>didn't <00:04:59.130>really <00:04:59.304>work

122
00:05:00.605 --> 00:05:02.285
<00:05:00.605>because <00:05:00.955>this <00:05:01.305>is <00:05:01.655>not <00:05:02.005>JavaScript.

123
00:05:02.355 --> 00:05:03.605
<00:05:02.355>This <00:05:02.730>is <00:05:03.105>actually <00:05:03.480>TypeScript

124
00:05:03.945 --> 00:05:06.165
<00:05:03.945>and <00:05:04.145>TypeScript <00:05:04.344>doesn't <00:05:04.545>let <00:05:04.745>you <00:05:04.945>pass <00:05:05.145>a <00:05:05.344>number

125
00:05:06.165 --> 00:05:08.845
<00:05:06.165>where <00:05:06.365>it <00:05:06.565>expects <00:05:06.765>the <00:05:06.965>number <00:05:07.165>TypeScript <00:05:07.365>people <00:05:07.565>think

126
00:05:08.965 --> 00:05:10.045
<00:05:08.965>this <00:05:09.289>makes <00:05:09.613>total <00:05:09.937>sense.

127
00:05:10.325 --> 00:05:12.325
<00:05:10.325>I <00:05:10.500>don't <00:05:10.675>really <00:05:10.849>know <00:05:11.025>this <00:05:11.200>is <00:05:11.375>still <00:05:11.550>a <00:05:11.724>problem,

128
00:05:12.425 --> 00:05:14.205
<00:05:12.425>but <00:05:12.705>how <00:05:12.985>can <00:05:13.265>you <00:05:13.545>convince <00:05:13.825>TypeScript

129
00:05:14.305 --> 00:05:15.565
<00:05:14.305>to <00:05:14.588>let <00:05:14.872>this <00:05:15.155>code <00:05:15.439>compile?

130
00:05:15.745 --> 00:05:18.485
<00:05:15.745>You <00:05:15.900>simply <00:05:16.056>assert <00:05:16.211>that <00:05:16.367>your <00:05:16.522>number <00:05:16.678>is <00:05:16.833>actually <00:05:16.989>a <00:05:17.145>number

131
00:05:18.705 --> 00:05:20.725
<00:05:18.705>and <00:05:18.860>then <00:05:19.016>you <00:05:19.171>can <00:05:19.327>pass <00:05:19.482>your <00:05:19.638>number <00:05:19.793>to <00:05:19.949>a <00:05:20.104>number

132
00:05:21.025 --> 00:05:24.085
<00:05:21.025>and <00:05:21.200>your <00:05:21.375>code <00:05:21.549>will <00:05:21.724>compile <00:05:21.900>and <00:05:22.075>work <00:05:22.250>and <00:05:22.424>run

133
00:05:24.345 --> 00:05:25.885
<00:05:24.345>and <00:05:24.543>you <00:05:24.741>don't <00:05:24.939>need <00:05:25.137>to <00:05:25.335>submit <00:05:25.533>any <00:05:25.731>pull

134
00:05:25.885 --> 00:05:26.965
<00:05:25.885>request, <00:05:26.209>fix <00:05:26.532>any <00:05:26.857>issues.

135
00:05:27.155 --> 00:05:28.525
<00:05:27.155>This <00:05:27.463>will <00:05:27.771>just <00:05:28.079>check <00:05:28.388>out

136
00:05:30.685 --> 00:05:33.355
<00:05:30.685>maybe <00:05:30.860>this <00:05:31.035>coat <00:05:31.210>even <00:05:31.385>still <00:05:31.560>runs <00:05:31.735>powering <00:05:31.910>this <00:05:32.085>presentation

137
00:05:33.355 --> 00:05:37.075
<00:05:33.355>maybe, <00:05:33.555>but <00:05:33.755>overall <00:05:33.955>this <00:05:34.155>is <00:05:34.355>not <00:05:34.555>really <00:05:34.755>all

138
00:05:37.075 --> 00:05:38.435
<00:05:37.075>that <00:05:37.319>bad <00:05:37.564>or <00:05:37.809>all <00:05:38.054>that <00:05:38.299>interesting.

139
00:05:38.515 --> 00:05:41.275
<00:05:38.515>I <00:05:38.655>mean <00:05:38.794>the <00:05:38.935>object <00:05:39.075>wrappers <00:05:39.215>exists <00:05:39.354>and <00:05:39.495>you <00:05:39.635>can <00:05:39.775>use <00:05:39.914>them,

140
00:05:41.375 --> 00:05:43.155
<00:05:41.375>but <00:05:41.575>you <00:05:41.775>can <00:05:41.975>also <00:05:42.175>really <00:05:42.375>easily <00:05:42.575>avoid <00:05:42.775>them.

141
00:05:43.175 --> 00:05:44.475
<00:05:43.175>The <00:05:43.409>mechanics <00:05:43.643>are <00:05:43.877>kind <00:05:44.111>of <00:05:44.345>obvious,

142
00:05:44.695 --> 00:05:46.835
<00:05:44.695>so <00:05:44.928>this <00:05:45.161>is <00:05:45.395>not <00:05:45.628>all <00:05:45.861>that <00:05:46.094>bad.

143
00:05:47.015 --> 00:05:49.395
<00:05:47.015>So <00:05:47.190>a <00:05:47.365>classical <00:05:47.539>case <00:05:47.715>of <00:05:47.890>not <00:05:48.065>great, <00:05:48.240>not <00:05:48.414>terrible,

144
00:05:49.765 --> 00:05:52.595
<00:05:49.765>let's <00:05:49.940>chuff <00:05:50.115>the <00:05:50.289>primitive <00:05:50.465>constructors <00:05:50.640>into <00:05:50.815>the <00:05:50.990>E <00:05:51.164>tier

145
00:05:52.855 --> 00:05:54.195
<00:05:52.855>and <00:05:53.257>move <00:05:53.659>swiftly <00:05:54.061>along.

146
00:05:54.605 --> 00:05:56.395
<00:05:54.605>Let's <00:05:54.885>move <00:05:55.165>along <00:05:55.445>to <00:05:55.725>writing <00:05:56.005>functions.

147
00:05:56.415 --> 00:05:58.925
<00:05:56.415>You <00:05:56.570>can <00:05:56.726>write <00:05:56.881>a <00:05:57.037>function <00:05:57.192>like <00:05:57.348>this, <00:05:57.503>which <00:05:57.659>you <00:05:57.815>know,

148
00:05:59.135 --> 00:06:01.965
<00:05:59.135>works <00:05:59.335>looks <00:05:59.534>good, <00:05:59.735>but <00:05:59.935>are <00:06:00.135>also <00:06:00.335>rather <00:06:00.534>boring.

149
00:06:02.345 --> 00:06:05.205
<00:06:02.345>Is <00:06:02.485>there <00:06:02.625>not <00:06:02.765>a <00:06:02.905>more <00:06:03.045>interesting <00:06:03.185>way <00:06:03.325>to <00:06:03.465>write <00:06:03.605>a <00:06:03.745>function?

150
00:06:05.305 --> 00:06:07.045
<00:06:05.305>Of <00:06:05.538>course, <00:06:05.771>all <00:06:06.005>the <00:06:06.238>interesting <00:06:06.471>bits <00:06:06.705>in

151
00:06:07.045 --> 00:06:08.445
<00:06:07.045>JavaScript <00:06:07.465>are <00:06:07.885>about <00:06:08.305>strengths.

152
00:06:08.825 --> 00:06:11.285
<00:06:08.825>You <00:06:08.965>can <00:06:09.104>use <00:06:09.245>the <00:06:09.385>function <00:06:09.525>constructor <00:06:09.664>if <00:06:09.805>you <00:06:09.945>really <00:06:10.085>want <00:06:10.224>to.

153
00:06:11.595 --> 00:06:14.125
<00:06:11.595>This <00:06:11.735>guy <00:06:11.875>takes <00:06:12.015>a <00:06:12.155>whole <00:06:12.295>bunch <00:06:12.435>of <00:06:12.575>strengths <00:06:12.715>as <00:06:12.855>its <00:06:12.995>input.

154
00:06:14.265 --> 00:06:16.485
<00:06:14.265>The <00:06:14.498>first <00:06:14.731>strengths <00:06:14.965>are <00:06:15.198>the <00:06:15.431>function <00:06:15.664>arguments

155
00:06:16.545 --> 00:06:18.285
<00:06:16.545>and <00:06:16.745>the <00:06:16.945>last <00:06:17.145>string <00:06:17.345>is <00:06:17.545>the <00:06:17.745>function <00:06:17.945>body.

156
00:06:18.505 --> 00:06:22.645
<00:06:18.505>So <00:06:18.621>this <00:06:18.738>is <00:06:18.855>more <00:06:18.971>or <00:06:19.088>less <00:06:19.205>the <00:06:19.321>same <00:06:19.438>as <00:06:19.555>this, <00:06:19.671>but <00:06:19.788>only <00:06:19.905>more

157
00:06:22.645 --> 00:06:24.405
<00:06:22.645>or <00:06:22.924>less <00:06:23.205>there <00:06:23.484>are <00:06:23.765>subtle <00:06:24.044>differences

158
00:06:24.665 --> 00:06:27.965
<00:06:24.665>and <00:06:24.792>I <00:06:24.919>actually <00:06:25.046>use, <00:06:25.174>um, <00:06:25.301>new <00:06:25.428>function <00:06:25.555>once <00:06:25.683>in <00:06:25.810>a <00:06:25.937>blue <00:06:26.065>moon

159
00:06:28.515 --> 00:06:30.525
<00:06:28.515>when, <00:06:28.794>well, <00:06:29.075>let's <00:06:29.354>consider <00:06:29.635>this <00:06:29.914>scenario.

160
00:06:31.355 --> 00:06:33.285
<00:06:31.355>I've <00:06:31.530>got <00:06:31.705>a <00:06:31.880>global <00:06:32.055>variable <00:06:32.230>X <00:06:32.405>in <00:06:32.580>line <00:06:32.755>one,

161
00:06:33.435 --> 00:06:36.325
<00:06:33.435>I've <00:06:33.590>got <00:06:33.746>an <00:06:33.901>outer <00:06:34.057>function <00:06:34.212>inside <00:06:34.368>there, <00:06:34.523>an <00:06:34.679>inner <00:06:34.835>function

162
00:06:36.385 --> 00:06:39.085
<00:06:36.385>and <00:06:36.540>there's <00:06:36.696>also <00:06:36.851>an <00:06:37.007>inner <00:06:37.162>value <00:06:37.318>X <00:06:37.473>in <00:06:37.629>line <00:06:37.784>four.

163
00:06:39.545 --> 00:06:42.325
<00:06:39.545>If <00:06:39.700>I <00:06:39.856>then <00:06:40.011>run <00:06:40.167>the <00:06:40.322>inner <00:06:40.478>function, <00:06:40.633>what <00:06:40.789>gets <00:06:40.945>written

164
00:06:42.345 --> 00:06:43.685
<00:06:42.345>to <00:06:42.586>the <00:06:42.827>console <00:06:43.068>in <00:06:43.309>line <00:06:43.551>six?

165
00:06:43.875 --> 00:06:46.165
<00:06:43.875>Well, <00:06:44.075>it's <00:06:44.275>obviously <00:06:44.475>gonna <00:06:44.675>be <00:06:44.875>the <00:06:45.075>string <00:06:45.275>A

166
00:06:46.165 --> 00:06:48.765
<00:06:46.165>because <00:06:46.365>the <00:06:46.565>inner <00:06:46.765>variable <00:06:46.965>shadows <00:06:47.165>the <00:06:47.365>outer <00:06:47.565>variable

167
00:06:48.865 --> 00:06:50.725
<00:06:48.865>and <00:06:49.065>there's <00:06:49.265>no <00:06:49.465>way <00:06:49.665>for <00:06:49.865>my <00:06:50.065>inner <00:06:50.265>function

168
00:06:50.725 --> 00:06:55.085
<00:06:50.725>to <00:06:50.865>access <00:06:51.005>the <00:06:51.145>outer <00:06:51.285>value <00:06:51.425>in <00:06:51.565>line <00:06:51.705>one <00:06:51.845>or <00:06:51.985>is <00:06:52.125>there?

169
00:06:55.435 --> 00:06:57.805
<00:06:55.435>Well, <00:06:55.635>you <00:06:55.835>can <00:06:56.035>always <00:06:56.235>take <00:06:56.435>the <00:06:56.635>inner <00:06:56.835>function

170
00:06:57.805 --> 00:06:59.965
<00:06:57.805>and <00:06:58.038>turn <00:06:58.271>it <00:06:58.505>into <00:06:58.738>a <00:06:58.971>function <00:06:59.205>constructed

171
00:06:59.985 --> 00:07:01.005
<00:06:59.985>by <00:07:00.291>the <00:07:00.597>function <00:07:00.903>constructor.

172
00:07:01.295 --> 00:07:04.285
<00:07:01.295>These <00:07:01.495>guys <00:07:01.695>always <00:07:01.895>execute <00:07:02.095>in <00:07:02.295>the <00:07:02.495>global <00:07:02.695>scope,

173
00:07:04.495 --> 00:07:07.605
<00:07:04.495>never <00:07:04.650>in <00:07:04.806>the <00:07:04.961>local <00:07:05.117>scope, <00:07:05.272>always <00:07:05.428>globally, <00:07:05.583>which <00:07:05.739>is <00:07:05.895>neat

174
00:07:07.605 --> 00:07:10.405
<00:07:07.605>because <00:07:07.760>using <00:07:07.916>this <00:07:08.071>I <00:07:08.227>can <00:07:08.382>access <00:07:08.538>the <00:07:08.693>variables <00:07:08.849>that <00:07:09.005>are

175
00:07:10.755 --> 00:07:13.405
<00:07:10.755>outside <00:07:10.955>no <00:07:11.155>matter <00:07:11.355>how <00:07:11.555>badly <00:07:11.755>they <00:07:11.955>are <00:07:12.155>shadowed

176
00:07:13.405 --> 00:07:14.565
<00:07:13.405>by <00:07:13.926>local <00:07:14.449>variables.

177
00:07:15.065 --> 00:07:16.165
<00:07:15.065>You <00:07:15.312>might <00:07:15.560>say, <00:07:15.807>you <00:07:16.055>know,

178
00:07:16.355 --> 00:07:18.205
<00:07:16.355>this <00:07:16.530>is <00:07:16.705>a <00:07:16.880>classical <00:07:17.055>case <00:07:17.230>of <00:07:17.405>a <00:07:17.580>skill <00:07:17.755>issue.

179
00:07:18.245 --> 00:07:20.525
<00:07:18.245>I <00:07:18.372>mean <00:07:18.499>this <00:07:18.626>works, <00:07:18.754>but <00:07:18.881>you <00:07:19.008>shouldn't <00:07:19.135>really <00:07:19.263>need <00:07:19.390>to <00:07:19.517>do <00:07:19.645>this

180
00:07:20.525 --> 00:07:22.365
<00:07:20.525>because <00:07:20.875>you <00:07:21.224>shouldn't <00:07:21.575>shadow <00:07:21.924>variables

181
00:07:22.365 --> 00:07:23.845
<00:07:22.365>that <00:07:22.587>you <00:07:22.809>don't <00:07:23.031>want <00:07:23.253>to <00:07:23.475>be <00:07:23.697>shadowed.

182
00:07:24.105 --> 00:07:26.325
<00:07:24.105>Um, <00:07:24.385>this <00:07:24.665>shouldn't <00:07:24.945>really <00:07:25.225>happen, <00:07:25.505>okay?

183
00:07:26.395 --> 00:07:27.925
<00:07:26.395>This <00:07:26.670>shouldn't <00:07:26.945>happen, <00:07:27.221>but <00:07:27.496>it <00:07:27.772>does

184
00:07:28.265 --> 00:07:31.565
<00:07:28.265>and <00:07:28.381>it <00:07:28.498>helps <00:07:28.615>you <00:07:28.731>to <00:07:28.848>get <00:07:28.965>out <00:07:29.081>of <00:07:29.198>a <00:07:29.315>lot <00:07:29.431>of <00:07:29.548>sticky <00:07:29.664>situations.

185
00:07:31.785 --> 00:07:34.205
<00:07:31.785>For <00:07:31.985>example, <00:07:32.185>if <00:07:32.385>this <00:07:32.585>variable <00:07:32.785>is <00:07:32.985>just <00:07:33.185>called

186
00:07:34.405 --> 00:07:35.445
<00:07:34.405>X, <00:07:34.561>then <00:07:34.717>this <00:07:34.873>is <00:07:35.029>not <00:07:35.185>a <00:07:35.341>problem.

187
00:07:35.745 --> 00:07:38.005
<00:07:35.745>How <00:07:35.920>important <00:07:36.095>can <00:07:36.270>the <00:07:36.445>outer <00:07:36.620>variable <00:07:36.795>X <00:07:36.970>really <00:07:37.145>be?

188
00:07:38.395 --> 00:07:40.525
<00:07:38.395>Well, <00:07:38.628>this <00:07:38.861>might <00:07:39.094>also <00:07:39.328>be <00:07:39.561>called <00:07:39.794>window,

189
00:07:40.625 --> 00:07:42.045
<00:07:40.625>and <00:07:40.767>now <00:07:40.909>you <00:07:41.051>are <00:07:41.193>in <00:07:41.335>a <00:07:41.477>bit <00:07:41.619>of <00:07:41.761>a <00:07:41.903>pickle

190
00:07:42.075 --> 00:07:44.445
<00:07:42.075>because <00:07:42.250>you <00:07:42.425>might <00:07:42.599>want <00:07:42.775>to <00:07:42.950>access <00:07:43.125>the <00:07:43.300>window <00:07:43.474>object,

191
00:07:44.585 --> 00:07:47.445
<00:07:44.585>but <00:07:44.740>some <00:07:44.896>Muppet <00:07:45.051>has <00:07:45.207>created <00:07:45.362>a <00:07:45.518>local <00:07:45.673>variable <00:07:45.829>called <00:07:45.984>window

192
00:07:47.665 --> 00:07:50.245
<00:07:47.665>and <00:07:47.840>this <00:07:48.015>blocks <00:07:48.190>you <00:07:48.365>from <00:07:48.540>accessing <00:07:48.715>the <00:07:48.890>global <00:07:49.065>object.

193
00:07:50.465 --> 00:07:52.085
<00:07:50.465>How <00:07:50.665>do <00:07:50.865>you <00:07:51.065>get <00:07:51.265>out <00:07:51.465>of <00:07:51.665>this <00:07:51.865>situation?

194
00:07:52.385 --> 00:07:54.125
<00:07:52.385>If <00:07:52.585>you <00:07:52.784>ask <00:07:52.985>me, <00:07:53.185>there's <00:07:53.385>only <00:07:53.585>one <00:07:53.784>way.

195
00:07:54.275 --> 00:07:55.965
<00:07:54.275>Turn <00:07:54.508>this <00:07:54.741>whole <00:07:54.974>thing <00:07:55.208>into <00:07:55.441>a <00:07:55.674>function

196
00:07:55.965 --> 00:07:57.645
<00:07:55.965>constructor <00:07:56.198>and <00:07:56.431>you <00:07:56.665>are <00:07:56.898>done <00:07:57.131>with <00:07:57.365>it.

197
00:07:57.955 --> 00:08:01.405
<00:07:57.955>Okay? <00:07:58.130>Now <00:07:58.305>of <00:07:58.479>course <00:07:58.655>an <00:07:58.830>an <00:07:59.005>audience <00:07:59.180>like <00:07:59.354>you,

198
00:08:01.745 --> 00:08:03.685
<00:08:01.745>you <00:08:01.945>are <00:08:02.145>acquainted <00:08:02.345>with <00:08:02.545>the <00:08:02.745>latest <00:08:02.945>and <00:08:03.145>greatest

199
00:08:03.685 --> 00:08:05.565
<00:08:03.685>and <00:08:03.840>Java <00:08:03.996>script <00:08:04.151>and <00:08:04.307>you <00:08:04.462>might <00:08:04.618>say, <00:08:04.773>if <00:08:04.929>you <00:08:05.085>want

200
00:08:05.565 --> 00:08:08.245
<00:08:05.565>to <00:08:05.740>access <00:08:05.915>the <00:08:06.090>global <00:08:06.265>object, <00:08:06.440>you <00:08:06.615>shouldn't <00:08:06.790>use <00:08:06.965>window,

201
00:08:08.545 --> 00:08:09.645
<00:08:08.545>you <00:08:08.875>should <00:08:09.205>use <00:08:09.534>global.

202
00:08:09.715 --> 00:08:11.485
<00:08:09.715>This, <00:08:09.994>which <00:08:10.275>is <00:08:10.554>essentially <00:08:10.835>an <00:08:11.114>alias

203
00:08:11.485 --> 00:08:12.565
<00:08:11.485>for <00:08:11.728>the <00:08:11.971>global <00:08:12.214>object <00:08:12.457>points

204
00:08:12.565 --> 00:08:14.685
<00:08:12.565>to <00:08:12.740>the <00:08:12.915>global <00:08:13.090>object <00:08:13.265>in <00:08:13.440>node <00:08:13.615>in <00:08:13.790>the <00:08:13.965>browser,

205
00:08:14.835 --> 00:08:18.405
<00:08:14.835>what <00:08:14.974>have <00:08:15.114>you <00:08:15.255>always <00:08:15.395>this <00:08:15.534>always <00:08:15.674>works, <00:08:15.815>but <00:08:15.955>you <00:08:16.094>know <00:08:16.234>what?

206
00:08:18.425 --> 00:08:20.765
<00:08:18.425>Global, <00:08:18.625>this <00:08:18.825>is <00:08:19.025>also <00:08:19.225>just <00:08:19.425>a <00:08:19.625>variable <00:08:19.825>name.

207
00:08:20.835 --> 00:08:23.925
<00:08:20.835>What <00:08:20.990>stops <00:08:21.146>a <00:08:21.301>troll <00:08:21.457>from <00:08:21.612>renaming <00:08:21.768>this <00:08:21.923>variable <00:08:22.079>to <00:08:22.234>global?

208
00:08:23.925 --> 00:08:26.925
<00:08:23.925>This <00:08:24.080>again, <00:08:24.236>and <00:08:24.391>then <00:08:24.547>you <00:08:24.702>are <00:08:24.858>stuck <00:08:25.013>again, <00:08:25.169>the <00:08:25.325>only

209
00:08:27.445 --> 00:08:29.365
<00:08:27.445>reliable <00:08:27.678>way <00:08:27.911>out <00:08:28.145>of <00:08:28.378>this <00:08:28.611>pickle <00:08:28.844>is

210
00:08:29.365 --> 00:08:30.965
<00:08:29.365>to <00:08:29.715>use <00:08:30.065>the <00:08:30.415>function <00:08:30.765>constructor.

211
00:08:31.625 --> 00:08:33.845
<00:08:31.625>And <00:08:31.825>this <00:08:32.025>is <00:08:32.225>true <00:08:32.424>for <00:08:32.625>so <00:08:32.825>many <00:08:33.025>values

212
00:08:33.955 --> 00:08:35.325
<00:08:33.955>that <00:08:34.263>you <00:08:34.571>might <00:08:34.879>want <00:08:35.188>excess.

213
00:08:35.825 --> 00:08:38.245
<00:08:35.825>You <00:08:35.980>didn't <00:08:36.136>think <00:08:36.291>undefined <00:08:36.447>was <00:08:36.602>a <00:08:36.758>special <00:08:36.913>token, <00:08:37.069>did <00:08:37.225>you?

214
00:08:39.395 --> 00:08:41.365
<00:08:39.395>This <00:08:39.550>is <00:08:39.706>just <00:08:39.861>a <00:08:40.017>variable <00:08:40.172>name. <00:08:40.328>You <00:08:40.483>can <00:08:40.639>shadow <00:08:40.794>this.

215
00:08:41.525 --> 00:08:42.925
<00:08:41.525>I <00:08:41.735>mean <00:08:41.944>you <00:08:42.155>shouldn't, <00:08:42.365>but <00:08:42.574>you <00:08:42.784>can.

216
00:08:43.205 --> 00:08:46.045
<00:08:43.205>N <00:08:43.485>you <00:08:43.765>cannot <00:08:44.045>overwrite <00:08:44.325>the <00:08:44.605>global

217
00:08:46.045 --> 00:08:47.885
<00:08:46.045>undefined <00:08:46.511>in <00:08:46.978>today's <00:08:47.444>browsers.

218
00:08:47.885 --> 00:08:49.685
<00:08:47.885>At <00:08:48.085>least <00:08:48.285>you <00:08:48.485>could <00:08:48.685>back <00:08:48.885>in <00:08:49.085>the <00:08:49.285>day.

219
00:08:49.745 --> 00:08:52.525
<00:08:49.745>But <00:08:49.920>nowadays <00:08:50.095>this <00:08:50.270>is <00:08:50.445>the, <00:08:50.620>um, <00:08:50.795>this <00:08:50.970>is <00:08:51.145>something

220
00:08:52.525 --> 00:08:54.765
<00:08:52.525>that <00:08:52.680>you <00:08:52.836>actually <00:08:52.991>can <00:08:53.147>do <00:08:53.302>if <00:08:53.458>you <00:08:53.613>really <00:08:53.769>want <00:08:53.925>to.

221
00:08:55.305 --> 00:08:57.645
<00:08:55.305>How <00:08:55.432>do <00:08:55.559>you <00:08:55.686>get <00:08:55.814>out <00:08:55.941>of <00:08:56.068>the <00:08:56.195>situation <00:08:56.323>if <00:08:56.450>you <00:08:56.577>ask <00:08:56.704>me,

222
00:08:57.705 --> 00:09:00.365
<00:08:57.705>you <00:08:57.860>know <00:08:58.016>the <00:08:58.171>answer, <00:08:58.327>you <00:08:58.482>just <00:08:58.638>use <00:08:58.793>the <00:08:58.949>function <00:08:59.105>constructor.

223
00:09:00.865 --> 00:09:03.045
<00:09:00.865>And <00:09:01.065>again, <00:09:01.265>you <00:09:01.465>might, <00:09:01.665>you <00:09:01.865>of <00:09:02.065>course <00:09:02.265>you

224
00:09:03.045 --> 00:09:04.765
<00:09:03.045>as <00:09:03.324>JavaScript <00:09:03.604>nerd <00:09:03.885>might <00:09:04.165>say, <00:09:04.444>well,

225
00:09:04.765 --> 00:09:07.205
<00:09:04.765>this <00:09:04.939>is <00:09:05.115>a <00:09:05.290>complicated <00:09:05.465>way <00:09:05.640>to <00:09:05.814>get <00:09:05.990>to <00:09:06.165>undefined.

226
00:09:07.565 --> 00:09:09.805
<00:09:07.565>I <00:09:07.765>should <00:09:07.965>not <00:09:08.165>talk <00:09:08.365>to <00:09:08.565>undefined <00:09:08.765>directly <00:09:08.965>anyway.

227
00:09:10.125 --> 00:09:13.645
<00:09:10.125>I <00:09:10.280>should <00:09:10.436>use <00:09:10.591>the <00:09:10.747>void <00:09:10.902>operator. <00:09:11.058>But <00:09:11.213>are <00:09:11.369>you <00:09:11.525>serious?

228
00:09:13.885 --> 00:09:16.085
<00:09:13.885>I <00:09:14.040>mean, <00:09:14.196>this <00:09:14.351>is <00:09:14.507>also <00:09:14.662>kind <00:09:14.818>of <00:09:14.973>a <00:09:15.129>strange <00:09:15.285>feature

229
00:09:16.085 --> 00:09:17.325
<00:09:16.085>that <00:09:16.457>nobody <00:09:16.829>ever <00:09:17.201>uses.

230
00:09:17.515 --> 00:09:19.405
<00:09:17.515>What <00:09:17.748>does <00:09:17.981>the <00:09:18.215>void <00:09:18.448>operator <00:09:18.681>actually <00:09:18.915>do?

231
00:09:19.625 --> 00:09:21.405
<00:09:19.625>It <00:09:19.800>has <00:09:19.975>nothing <00:09:20.150>to <00:09:20.325>do <00:09:20.500>with <00:09:20.675>the <00:09:20.850>void <00:09:21.025>type

232
00:09:21.405 --> 00:09:23.525
<00:09:21.405>and <00:09:21.638>TypeScript, <00:09:21.871>hence <00:09:22.105>the <00:09:22.338>exactly <00:09:22.571>same <00:09:22.805>name.

233
00:09:23.785 --> 00:09:26.165
<00:09:23.785>No, <00:09:23.940>this <00:09:24.096>is <00:09:24.251>an <00:09:24.407>operator <00:09:24.562>that <00:09:24.718>does <00:09:24.873>uh, <00:09:25.029>one <00:09:25.185>thing,

234
00:09:26.225 --> 00:09:28.085
<00:09:26.225>it <00:09:26.505>accepts <00:09:26.785>an <00:09:27.065>input, <00:09:27.345>does <00:09:27.625>nothing

235
00:09:28.085 --> 00:09:29.725
<00:09:28.085>with <00:09:28.365>the <00:09:28.645>input <00:09:28.925>and <00:09:29.205>returns <00:09:29.485>undefined.

236
00:09:30.385 --> 00:09:32.605
<00:09:30.385>So <00:09:30.618>it <00:09:30.851>takes <00:09:31.085>some <00:09:31.318>instruction, <00:09:31.551>does <00:09:31.785>nothing

237
00:09:32.625 --> 00:09:34.645
<00:09:32.625>and <00:09:32.780>returns <00:09:32.936>nothing <00:09:33.091>kind <00:09:33.247>of <00:09:33.402>like <00:09:33.558>me <00:09:33.713>on <00:09:33.869>a <00:09:34.025>Monday.

238
00:09:36.705 --> 00:09:38.205
<00:09:36.705>And <00:09:36.930>this <00:09:37.155>works <00:09:37.380>for <00:09:37.605>many <00:09:37.830>other <00:09:38.055>things.

239
00:09:38.365 --> 00:09:41.085
<00:09:38.365>Infinity <00:09:38.520>can <00:09:38.676>also <00:09:38.831>be <00:09:38.987>shadowed. <00:09:39.142>It's <00:09:39.298>just <00:09:39.453>a <00:09:39.609>variable <00:09:39.765>name.

240
00:09:41.265 --> 00:09:42.445
<00:09:41.265>And <00:09:41.530>you <00:09:41.796>again <00:09:42.061>might <00:09:42.327>say,

241
00:09:42.545 --> 00:09:44.325
<00:09:42.545>now <00:09:42.719>I <00:09:42.895>don't <00:09:43.069>need <00:09:43.245>to <00:09:43.420>write <00:09:43.594>a <00:09:43.770>new <00:09:43.944>function.

242
00:09:44.645 --> 00:09:47.445
<00:09:44.645>I <00:09:44.772>can <00:09:44.899>get <00:09:45.026>to <00:09:45.154>infinity <00:09:45.281>the <00:09:45.408>old <00:09:45.535>fashioned <00:09:45.663>way <00:09:45.790>by <00:09:45.917>taking <00:09:46.045>42,

243
00:09:47.445 --> 00:09:48.765
<00:09:47.445>dividing <00:09:47.742>it <00:09:48.039>by <00:09:48.336>an <00:09:48.633>MTRA

244
00:09:48.785 --> 00:09:51.165
<00:09:48.785>and <00:09:48.985>this <00:09:49.185>gives <00:09:49.385>me <00:09:49.584>infinity, <00:09:49.785>which <00:09:49.985>is <00:09:50.185>true,

245
00:09:51.425 --> 00:09:53.725
<00:09:51.425>but <00:09:51.599>come <00:09:51.775>on, <00:09:51.949>this <00:09:52.125>pattern <00:09:52.300>is <00:09:52.474>even <00:09:52.650>stranger <00:09:52.824>than

246
00:09:53.725 --> 00:09:54.885
<00:09:53.725>writing <00:09:54.073>a <00:09:54.421>new <00:09:54.769>function.

247
00:09:55.285 --> 00:09:56.725
<00:09:55.285>I <00:09:55.501>don't, <00:09:55.717>uh, <00:09:55.933>think <00:09:56.149>that <00:09:56.365>new <00:09:56.581>function

248
00:09:56.725 --> 00:09:57.765
<00:09:56.725>is <00:09:56.912>a <00:09:57.099>bad <00:09:57.286>pattern <00:09:57.473>at <00:09:57.661>all.

249
00:09:57.905 --> 00:10:00.125
<00:09:57.905>It <00:09:58.045>can <00:09:58.185>get <00:09:58.324>you <00:09:58.464>out <00:09:58.605>of <00:09:58.745>a <00:09:58.885>bunch <00:09:59.025>of <00:09:59.165>sticky <00:09:59.305>situations

250
00:10:00.125 --> 00:10:01.365
<00:10:00.125>and <00:10:00.311>this <00:10:00.497>is <00:10:00.683>just <00:10:00.869>one <00:10:01.055>of <00:10:01.241>them.

251
00:10:01.845 --> 00:10:03.125
<00:10:01.845>I <00:10:02.037>don't <00:10:02.229>have <00:10:02.421>time <00:10:02.613>for <00:10:02.805>the <00:10:02.997>rest,

252
00:10:03.385 --> 00:10:05.525
<00:10:03.385>but <00:10:03.560>in <00:10:03.735>summary, <00:10:03.910>new <00:10:04.085>function <00:10:04.260>is <00:10:04.435>actually <00:10:04.610>a <00:10:04.785>feature.

253
00:10:06.365 --> 00:10:08.405
<00:10:06.365>I <00:10:06.598>mean <00:10:06.831>the <00:10:07.065>ability <00:10:07.298>to <00:10:07.531>shadow <00:10:07.765>built-ins,

254
00:10:08.435 --> 00:10:09.805
<00:10:08.435>this <00:10:08.743>is <00:10:09.051>dumb <00:10:09.359>and <00:10:09.667>confusing.

255
00:10:09.925 --> 00:10:11.645
<00:10:09.925>I <00:10:10.125>agree <00:10:10.324>with <00:10:10.525>this, <00:10:10.724>this <00:10:10.925>shouldn't <00:10:11.125>be <00:10:11.324>happening.

256
00:10:11.865 --> 00:10:12.965
<00:10:11.865>Um, <00:10:12.195>but <00:10:12.525>it <00:10:12.855>does.

257
00:10:13.035 --> 00:10:14.405
<00:10:13.035>It's <00:10:13.240>a <00:10:13.445>feature, <00:10:13.651>it's <00:10:13.857>kind <00:10:14.062>of <00:10:14.268>curse,

258
00:10:14.425 --> 00:10:17.605
<00:10:14.425>but <00:10:14.552>we <00:10:14.679>have <00:10:14.806>to <00:10:14.934>deal <00:10:15.061>with <00:10:15.188>this <00:10:15.315>void <00:10:15.443>is <00:10:15.570>dumb <00:10:15.697>and <00:10:15.824>confusing.

259
00:10:17.865 --> 00:10:20.645
<00:10:17.865>Not, <00:10:18.065>shouldn't <00:10:18.265>really <00:10:18.465>be <00:10:18.665>necessary <00:10:18.865>if <00:10:19.065>seed <00:10:19.265>shadowing

260
00:10:20.645 --> 00:10:22.485
<00:10:20.645>built-ins <00:10:20.878>wasn't <00:10:21.111>a <00:10:21.345>thing, <00:10:21.578>but <00:10:21.811>it's <00:10:22.045>mostly

261
00:10:22.485 --> 00:10:23.645
<00:10:22.485>harmless <00:10:22.693>so <00:10:22.902>we <00:10:23.111>can <00:10:23.320>ignore <00:10:23.529>it.

262
00:10:23.905 --> 00:10:26.685
<00:10:23.905>But <00:10:24.060>new <00:10:24.216>function <00:10:24.371>is <00:10:24.527>actually <00:10:24.682>a <00:10:24.838>feature <00:10:24.993>in <00:10:25.149>my <00:10:25.305>opinion.

263
00:10:26.905 --> 00:10:28.725
<00:10:26.905>You <00:10:27.079>don't <00:10:27.255>need <00:10:27.430>to <00:10:27.605>use <00:10:27.780>it <00:10:27.954>all <00:10:28.130>the <00:10:28.305>time,

264
00:10:28.985 --> 00:10:30.565
<00:10:28.985>but <00:10:29.160>if <00:10:29.335>you <00:10:29.510>are <00:10:29.685>in <00:10:29.860>this, <00:10:30.035>in <00:10:30.210>this <00:10:30.385>situation

265
00:10:30.565 --> 00:10:32.245
<00:10:30.565>where <00:10:30.845>only <00:10:31.125>new <00:10:31.405>function <00:10:31.685>will <00:10:31.965>work,

266
00:10:32.395 --> 00:10:34.005
<00:10:32.395>then <00:10:32.861>there's <00:10:33.328>no <00:10:33.795>alternative.

267
00:10:34.185 --> 00:10:38.085
<00:10:34.185>New <00:10:34.301>function <00:10:34.418>is <00:10:34.535>a <00:10:34.651>feature, <00:10:34.768>it <00:10:34.885>is <00:10:35.001>it <00:10:35.118>slots <00:10:35.234>right <00:10:35.351>into <00:10:35.468>the <00:10:35.584>FTO

268
00:10:38.305 --> 00:10:40.645
<00:10:38.305>and <00:10:38.538>the <00:10:38.771>rest, <00:10:39.005>you <00:10:39.238>know, <00:10:39.471>it's <00:10:39.704>middling.

269
00:10:41.925 --> 00:10:44.455
<00:10:41.925>Alright, <00:10:42.204>um, <00:10:42.484>talking <00:10:42.765>about <00:10:43.045>global <00:10:43.324>variables,

270
00:10:44.455 --> 00:10:46.215
<00:10:44.455>has <00:10:44.688>anyone <00:10:44.921>ever <00:10:45.155>noticed <00:10:45.388>how <00:10:45.621>global <00:10:45.855>variables

271
00:10:46.515 --> 00:10:47.775
<00:10:46.515>are <00:10:46.893>kind <00:10:47.271>of <00:10:47.649>strange?

272
00:10:48.405 --> 00:10:52.335
<00:10:48.405>Like <00:10:48.545>you <00:10:48.685>can <00:10:48.824>simply <00:10:48.964>stick <00:10:49.105>a <00:10:49.245>new <00:10:49.385>property <00:10:49.525>on <00:10:49.665>the <00:10:49.805>window,

273
00:10:52.335 --> 00:10:54.375
<00:10:52.335>object <00:10:52.535>on <00:10:52.735>your, <00:10:52.935>the <00:10:53.135>global <00:10:53.335>object <00:10:53.535>in <00:10:53.735>JavaScript

274
00:10:54.555 --> 00:10:56.415
<00:10:54.555>and <00:10:54.788>suddenly <00:10:55.021>you <00:10:55.255>get <00:10:55.488>a <00:10:55.721>global <00:10:55.954>variable.

275
00:10:57.465 --> 00:11:00.175
<00:10:57.465>Isn't <00:10:57.640>this <00:10:57.815>kind <00:10:57.990>of <00:10:58.165>strange? <00:10:58.340>How <00:10:58.515>does <00:10:58.690>this <00:10:58.865>work?

276
00:11:00.175 --> 00:11:02.015
<00:11:00.175>Nothing <00:11:00.408>else <00:11:00.641>in <00:11:00.875>JavaScript <00:11:01.108>works <00:11:01.341>like <00:11:01.574>this.

277
00:11:02.115 --> 00:11:04.855
<00:11:02.115>You <00:11:02.315>can <00:11:02.515>also <00:11:02.715>reassign <00:11:02.915>the <00:11:03.115>global <00:11:03.315>variable <00:11:03.515>X

278
00:11:05.035 --> 00:11:08.655
<00:11:05.035>and <00:11:05.175>the <00:11:05.314>object <00:11:05.454>property <00:11:05.594>on <00:11:05.735>window <00:11:05.875>will <00:11:06.015>also <00:11:06.155>update <00:11:06.295>and <00:11:06.435>turn.

279
00:11:09.845 --> 00:11:12.735
<00:11:09.845>This <00:11:10.078>is <00:11:10.311>interesting. <00:11:10.545>Okay, <00:11:10.778>I <00:11:11.011>now <00:11:11.245>risk

280
00:11:12.755 --> 00:11:14.855
<00:11:12.755>to <00:11:12.955>actually <00:11:13.155>teach <00:11:13.355>you <00:11:13.555>something, <00:11:13.755>bear <00:11:13.955>with <00:11:14.155>me.

281
00:11:15.065 --> 00:11:17.335
<00:11:15.065>There <00:11:15.240>is <00:11:15.415>this <00:11:15.590>thing <00:11:15.765>in <00:11:15.940>the <00:11:16.115>ECMO <00:11:16.290>script <00:11:16.465>specification

282
00:11:17.335 --> 00:11:18.415
<00:11:17.335>called <00:11:17.821>environment <00:11:18.307>records.

283
00:11:18.675 --> 00:11:21.655
<00:11:18.675>And <00:11:18.814>this <00:11:18.954>roughly <00:11:19.094>maps <00:11:19.234>to <00:11:19.375>what <00:11:19.515>we <00:11:19.655>as <00:11:19.795>developers <00:11:19.935>think <00:11:20.074>of

284
00:11:21.715 --> 00:11:23.495
<00:11:21.715>as <00:11:22.065>scopes <00:11:22.415>in <00:11:22.765>our <00:11:23.115>functions

285
00:11:23.575 --> 00:11:25.375
<00:11:23.575>and <00:11:23.775>in <00:11:23.975>our <00:11:24.175>modules <00:11:24.375>there's <00:11:24.575>a <00:11:24.775>whole <00:11:24.975>bunch

286
00:11:25.375 --> 00:11:26.855
<00:11:25.375>of <00:11:25.708>different <00:11:26.041>environment <00:11:26.374>record <00:11:26.707>types.

287
00:11:26.925 --> 00:11:28.335
<00:11:26.925>There's <00:11:27.348>the <00:11:27.771>global <00:11:28.194>environment

288
00:11:28.475 --> 00:11:30.775
<00:11:28.475>and <00:11:28.650>in <00:11:28.825>there <00:11:29.000>you <00:11:29.175>can <00:11:29.350>have <00:11:29.525>your <00:11:29.700>declarative <00:11:29.875>environments.

289
00:11:30.805 --> 00:11:32.495
<00:11:30.805>This <00:11:31.038>would <00:11:31.271>be <00:11:31.505>your <00:11:31.738>functions <00:11:31.971>for <00:11:32.204>example.

290
00:11:32.875 --> 00:11:35.655
<00:11:32.875>And <00:11:33.108>this <00:11:33.341>roughly <00:11:33.575>again, <00:11:33.808>maps <00:11:34.041>to <00:11:34.275>scopes.

291
00:11:35.835 --> 00:11:38.135
<00:11:35.835>Um, <00:11:36.010>in <00:11:36.185>this <00:11:36.360>example, <00:11:36.535>the <00:11:36.710>global <00:11:36.885>environment <00:11:37.060>contains <00:11:37.235>a

292
00:11:38.135 --> 00:11:39.375
<00:11:38.135>declaration <00:11:38.414>for <00:11:38.693>the <00:11:38.972>function <00:11:39.251>four

293
00:11:39.515 --> 00:11:41.775
<00:11:39.515>and <00:11:39.715>a <00:11:39.915>variable <00:11:40.115>declaration <00:11:40.314>for <00:11:40.515>X <00:11:40.715>equals <00:11:40.915>one.

294
00:11:42.045 --> 00:11:43.335
<00:11:42.045>This <00:11:42.335>is <00:11:42.625>your <00:11:42.915>global <00:11:43.206>environment.

295
00:11:43.335 --> 00:11:44.815
<00:11:43.335>And <00:11:43.601>then <00:11:43.867>there's <00:11:44.134>the, <00:11:44.400>the <00:11:44.667>declarative

296
00:11:44.815 --> 00:11:46.215
<00:11:44.815>environment <00:11:45.235>inside <00:11:45.655>the <00:11:46.075>function.

297
00:11:46.395 --> 00:11:48.735
<00:11:46.395>And <00:11:46.595>the <00:11:46.795>declarative <00:11:46.995>environment <00:11:47.194>is <00:11:47.395>the <00:11:47.595>child <00:11:47.795>environment

298
00:11:48.735 --> 00:11:49.735
<00:11:48.735>of <00:11:49.035>the <00:11:49.335>global <00:11:49.635>environment.

299
00:11:49.835 --> 00:11:52.535
<00:11:49.835>The <00:11:50.010>visibility <00:11:50.185>of <00:11:50.360>the <00:11:50.535>outer <00:11:50.710>variables <00:11:50.885>leaks <00:11:51.060>into <00:11:51.235>the

300
00:11:52.535 --> 00:11:54.525
<00:11:52.535>declarative <00:11:52.885>environment <00:11:53.235>that's <00:11:53.584>nested <00:11:53.935>inside.

301
00:11:54.705 --> 00:11:56.485
<00:11:54.705>And <00:11:54.905>this <00:11:55.105>all <00:11:55.305>makes <00:11:55.505>a <00:11:55.705>bunch <00:11:55.905>of <00:11:56.105>sense.

302
00:11:56.815 --> 00:11:59.365
<00:11:56.815>Again, <00:11:57.048>it <00:11:57.281>nets <00:11:57.515>to <00:11:57.748>scopes <00:11:57.981>quite <00:11:58.215>neatly.

303
00:11:59.795 --> 00:12:01.845
<00:11:59.795>Okay, <00:12:00.028>how <00:12:00.261>is <00:12:00.495>this <00:12:00.728>interesting <00:12:00.961>at <00:12:01.194>all?

304
00:12:01.875 --> 00:12:03.805
<00:12:01.875>Well, <00:12:02.155>the <00:12:02.435>global <00:12:02.715>environment <00:12:02.995>is <00:12:03.275>special.

305
00:12:04.225 --> 00:12:06.205
<00:12:04.225>It <00:12:04.505>is <00:12:04.785>or <00:12:05.065>else <00:12:05.345>being <00:12:05.625>equal.

306
00:12:06.505 --> 00:12:08.645
<00:12:06.505>The <00:12:06.705>only <00:12:06.905>environment <00:12:07.105>that <00:12:07.305>is <00:12:07.505>a <00:12:07.705>mix <00:12:07.905>in

307
00:12:08.645 --> 00:12:09.885
<00:12:08.645>of <00:12:09.016>a <00:12:09.389>declarative <00:12:09.761>environment,

308
00:12:09.955 --> 00:12:12.165
<00:12:09.955>your <00:12:10.188>regular <00:12:10.421>variable <00:12:10.655>declarations <00:12:10.888>and <00:12:11.121>so <00:12:11.355>on,

309
00:12:12.505 --> 00:12:14.005
<00:12:12.505>and <00:12:12.955>an <00:12:13.405>object <00:12:13.855>environment

310
00:12:14.005 --> 00:12:16.645
<00:12:14.005>and <00:12:14.205>an <00:12:14.405>object <00:12:14.605>environment <00:12:14.805>has <00:12:15.005>an <00:12:15.205>object <00:12:15.405>attached

311
00:12:16.645 --> 00:12:18.085
<00:12:16.645>to <00:12:16.969>it <00:12:17.293>which <00:12:17.617>basically <00:12:17.941>serves

312
00:12:18.085 --> 00:12:20.045
<00:12:18.085>as <00:12:18.318>the <00:12:18.551>backend <00:12:18.785>storage <00:12:19.018>for <00:12:19.251>the <00:12:19.485>environment.

313
00:12:20.215 --> 00:12:22.525
<00:12:20.215>There <00:12:20.390>is <00:12:20.565>an <00:12:20.740>object <00:12:20.915>where <00:12:21.090>all <00:12:21.265>the <00:12:21.440>data <00:12:21.615>lives

314
00:12:22.665 --> 00:12:23.885
<00:12:22.665>for <00:12:23.031>all <00:12:23.396>the <00:12:23.763>variables.

315
00:12:23.945 --> 00:12:25.885
<00:12:23.945>And <00:12:24.178>this <00:12:24.411>is <00:12:24.645>what <00:12:24.878>window <00:12:25.111>essentially <00:12:25.345>does.

316
00:12:25.885 --> 00:12:28.525
<00:12:25.885>Window <00:12:26.060>is <00:12:26.235>the <00:12:26.410>backend <00:12:26.585>storage <00:12:26.760>for <00:12:26.935>your <00:12:27.110>global <00:12:27.285>scope.

317
00:12:28.905 --> 00:12:31.285
<00:12:28.905>And <00:12:29.079>this <00:12:29.255>is <00:12:29.430>just, <00:12:29.605>you <00:12:29.780>know, <00:12:29.954>a <00:12:30.130>magical <00:12:30.305>property

318
00:12:31.345 --> 00:12:33.285
<00:12:31.345>of <00:12:31.625>this <00:12:31.905>environment <00:12:32.185>window <00:12:32.465>is <00:12:32.745>special

319
00:12:33.285 --> 00:12:35.645
<00:12:33.285>because <00:12:33.518>it's <00:12:33.751>attached <00:12:33.985>to <00:12:34.218>a <00:12:34.451>special <00:12:34.685>environment,

320
00:12:35.825 --> 00:12:38.405
<00:12:35.825>to <00:12:35.965>a <00:12:36.105>special <00:12:36.245>scope <00:12:36.385>where <00:12:36.525>we <00:12:36.665>have <00:12:36.805>an <00:12:36.945>object <00:12:37.085>that <00:12:37.225>serves

321
00:12:38.405 --> 00:12:40.245
<00:12:38.405>as <00:12:38.871>the <00:12:39.338>backend <00:12:39.805>essentially.

322
00:12:40.755 --> 00:12:43.045
<00:12:40.755>Okay, <00:12:40.955>that's <00:12:41.155>neat. <00:12:41.355>But <00:12:41.555>why <00:12:41.755>is <00:12:41.955>window <00:12:42.155>special?

323
00:12:43.785 --> 00:12:46.005
<00:12:43.785>Why <00:12:43.940>can't <00:12:44.096>I <00:12:44.251>have <00:12:44.407>my <00:12:44.562>own <00:12:44.718>window, <00:12:44.873>my <00:12:45.029>own <00:12:45.185>object?

324
00:12:46.005 --> 00:12:48.085
<00:12:46.005>That's <00:12:46.238>a <00:12:46.471>binding <00:12:46.705>object <00:12:46.938>for <00:12:47.171>a <00:12:47.405>declarative

325
00:12:48.085 --> 00:12:49.285
<00:12:48.085>and <00:12:48.355>for <00:12:48.625>an <00:12:48.895>object <00:12:49.165>environment.

326
00:12:49.555 --> 00:12:52.605
<00:12:49.555>What <00:12:49.662>is, <00:12:49.770>what <00:12:49.878>what <00:12:49.985>should <00:12:50.093>I <00:12:50.201>do <00:12:50.308>if <00:12:50.416>I <00:12:50.524>wanted <00:12:50.631>my <00:12:50.739>object <00:12:50.847>o <00:12:50.954>in

327
00:12:52.605 --> 00:12:54.885
<00:12:52.605>here, <00:12:52.838>in <00:12:53.071>here, <00:12:53.305>be <00:12:53.538>a <00:12:53.771>binding <00:12:54.005>object

328
00:12:54.905 --> 00:12:56.445
<00:12:54.905>for <00:12:55.251>some <00:12:55.598>sort <00:12:55.944>of <00:12:56.291>environment.

329
00:12:57.275 --> 00:13:00.765
<00:12:57.275>Well, <00:12:57.415>I've <00:12:57.555>got <00:12:57.694>some <00:12:57.834>good <00:12:57.975>slash <00:12:58.115>extremely <00:12:58.255>bad <00:12:58.395>news <00:12:58.535>for <00:12:58.675>you.

330
00:13:00.985 --> 00:13:03.725
<00:13:00.985>You <00:13:01.125>can <00:13:01.265>actually <00:13:01.405>do <00:13:01.545>this. <00:13:01.685>You <00:13:01.825>can <00:13:01.965>use <00:13:02.105>the <00:13:02.245>width <00:13:02.385>statement.

331
00:13:03.725 --> 00:13:04.845
<00:13:03.725>Anyone <00:13:03.977>ever <00:13:04.229>use <00:13:04.481>this <00:13:04.733>guy?

332
00:13:06.305 --> 00:13:09.005
<00:13:06.305>No <00:13:06.432>one, <00:13:06.559>no <00:13:06.686>one <00:13:06.814>in <00:13:06.941>this <00:13:07.068>entire <00:13:07.195>hall <00:13:07.323>has <00:13:07.450>ever <00:13:07.577>written <00:13:07.704>this.

333
00:13:09.315 --> 00:13:11.325
<00:13:09.315>Okay, <00:13:09.455>great. <00:13:09.595>Then <00:13:09.735>at <00:13:09.875>least <00:13:10.015>I <00:13:10.155>won't <00:13:10.295>bore <00:13:10.435>you <00:13:10.575>to <00:13:10.715>tears

334
00:13:11.585 --> 00:13:14.205
<00:13:11.585>by <00:13:11.740>telling <00:13:11.896>you <00:13:12.051>that <00:13:12.207>the <00:13:12.362>width <00:13:12.518>statement <00:13:12.673>takes <00:13:12.829>an <00:13:12.985>object

335
00:13:14.225 --> 00:13:17.485
<00:13:14.225>as <00:13:14.380>its <00:13:14.536>input <00:13:14.691>and <00:13:14.847>then <00:13:15.002>creates <00:13:15.158>a <00:13:15.313>temporary <00:13:15.469>object <00:13:15.625>environment

336
00:13:17.485 --> 00:13:20.765
<00:13:17.485>record <00:13:17.625>at <00:13:17.765>the <00:13:17.905>end <00:13:18.045>of <00:13:18.185>the <00:13:18.325>block <00:13:18.465>discards <00:13:18.605>the <00:13:18.745>new, <00:13:18.885>um,

337
00:13:20.765 --> 00:13:23.445
<00:13:20.765>object <00:13:20.998>environment <00:13:21.231>record, <00:13:21.465>which <00:13:21.698>means <00:13:21.931>that <00:13:22.165>only

338
00:13:23.505 --> 00:13:25.405
<00:13:23.505>inside <00:13:23.855>this <00:13:24.205>block <00:13:24.555>the <00:13:24.905>variables

339
00:13:25.405 --> 00:13:28.245
<00:13:25.405>that <00:13:25.545>you <00:13:25.685>can <00:13:25.824>access <00:13:25.964>in <00:13:26.105>there <00:13:26.245>are <00:13:26.385>stored <00:13:26.525>on <00:13:26.665>the <00:13:26.805>object,

340
00:13:28.575 --> 00:13:32.485
<00:13:28.575>which <00:13:28.715>means <00:13:28.855>you <00:13:28.995>can <00:13:29.135>simply <00:13:29.275>access <00:13:29.415>X <00:13:29.555>in <00:13:29.695>there <00:13:29.835>even <00:13:29.975>though

341
00:13:32.585 --> 00:13:36.285
<00:13:32.585>nobody <00:13:32.725>has <00:13:32.865>ever <00:13:33.005>declared <00:13:33.145>a <00:13:33.285>variable <00:13:33.425>X <00:13:33.565>isn't <00:13:33.705>there <00:13:33.845>this <00:13:33.985>need?

342
00:13:36.285 --> 00:13:37.805
<00:13:36.285>And <00:13:36.512>if <00:13:36.741>you <00:13:36.968>declare <00:13:37.197>a <00:13:37.425>variable <00:13:37.652>X,

343
00:13:37.915 --> 00:13:39.165
<00:13:37.915>your <00:13:38.196>program <00:13:38.477>will <00:13:38.758>do <00:13:39.040>the

344
00:13:39.165 --> 00:13:40.485
<00:13:39.165>exact <00:13:39.334>opposite <00:13:39.504>of <00:13:39.674>what <00:13:39.843>you <00:13:40.013>think <00:13:40.183>it <00:13:40.353>does.

345
00:13:41.665 --> 00:13:44.005
<00:13:41.665>But <00:13:41.865>this <00:13:42.064>is <00:13:42.265>not <00:13:42.464>only <00:13:42.665>confusing <00:13:42.865>for <00:13:43.064>developers,

346
00:13:44.145 --> 00:13:46.965
<00:13:44.145>but <00:13:44.345>this <00:13:44.545>is <00:13:44.745>also <00:13:44.944>confusing <00:13:45.145>for <00:13:45.345>engine <00:13:45.545>implementers,

347
00:13:46.965 --> 00:13:48.925
<00:13:46.965>for <00:13:47.431>JavaScript <00:13:47.898>engines <00:13:48.365>themselves.

348
00:13:49.115 --> 00:13:52.605
<00:13:49.115>Because <00:13:49.315>if <00:13:49.515>you, <00:13:49.715>um, <00:13:49.915>disregard <00:13:50.115>the <00:13:50.315>risk <00:13:50.515>statement,

349
00:13:52.605 --> 00:13:54.205
<00:13:52.605>if <00:13:52.955>you <00:13:53.305>disregard <00:13:53.655>the <00:13:54.005>possibility

350
00:13:54.205 --> 00:13:56.485
<00:13:54.205>of <00:13:54.485>creating <00:13:54.765>temporary <00:13:55.045>object <00:13:55.325>environment <00:13:55.605>records,

351
00:13:56.875 --> 00:13:59.845
<00:13:56.875>then <00:13:57.050>the <00:13:57.225>location <00:13:57.400>of <00:13:57.575>every <00:13:57.750>variable <00:13:57.925>can <00:13:58.100>be <00:13:58.275>determined

352
00:13:59.845 --> 00:14:01.565
<00:13:59.845>by <00:14:00.195>using <00:14:00.545>static <00:14:00.895>analysis, <00:14:01.245>right?

353
00:14:01.825 --> 00:14:04.045
<00:14:01.825>You <00:14:01.952>can <00:14:02.079>look <00:14:02.206>at <00:14:02.334>your <00:14:02.461>code, <00:14:02.588>you <00:14:02.715>can <00:14:02.843>see <00:14:02.970>where <00:14:03.097>your <00:14:03.225>functions

354
00:14:04.045 --> 00:14:06.125
<00:14:04.045>and <00:14:04.245>your <00:14:04.444>arguments <00:14:04.645>and <00:14:04.844>your <00:14:05.045>variables <00:14:05.245>are <00:14:05.444>declared,

355
00:14:06.385 --> 00:14:09.325
<00:14:06.385>but <00:14:06.540>north <00:14:06.696>if <00:14:06.851>width <00:14:07.007>is, <00:14:07.162>um, <00:14:07.318>is <00:14:07.473>still <00:14:07.629>an <00:14:07.785>option

356
00:14:09.745 --> 00:14:11.765
<00:14:09.745>and <00:14:10.025>this <00:14:10.305>makes <00:14:10.585>JavaScript <00:14:10.865>slower <00:14:11.145>than

357
00:14:11.765 --> 00:14:13.005
<00:14:11.765>than <00:14:12.044>it <00:14:12.323>otherwise <00:14:12.602>could <00:14:12.881>be.

358
00:14:13.005 --> 00:14:14.965
<00:14:13.005>Certain <00:14:13.471>optimizations <00:14:13.938>are <00:14:14.405>impossible

359
00:14:14.965 --> 00:14:17.965
<00:14:14.965>because <00:14:15.165>you <00:14:15.365>cannot <00:14:15.565>statically <00:14:15.765>analyze <00:14:15.965>a <00:14:16.165>JavaScript <00:14:16.365>program

360
00:14:17.985 --> 00:14:20.205
<00:14:17.985>and <00:14:18.185>determine <00:14:18.385>where <00:14:18.585>all <00:14:18.785>the <00:14:18.985>variables <00:14:19.185>come <00:14:19.385>from.

361
00:14:20.515 --> 00:14:23.285
<00:14:20.515>It's <00:14:20.795>entirely <00:14:21.074>impossible. <00:14:21.355>Isn't <00:14:21.635>this <00:14:21.915>neat?

362
00:14:23.385 --> 00:14:24.445
<00:14:23.385>The <00:14:23.862>sheer <00:14:24.339>existence

363
00:14:24.445 --> 00:14:26.525
<00:14:24.445>of <00:14:24.678>this <00:14:24.911>feature <00:14:25.145>makes <00:14:25.378>your <00:14:25.611>code <00:14:25.845>slower

364
00:14:26.525 --> 00:14:27.725
<00:14:26.525>than <00:14:26.795>it <00:14:27.065>otherwise <00:14:27.335>would <00:14:27.605>be.

365
00:14:28.355 --> 00:14:30.565
<00:14:28.355>This <00:14:28.530>is <00:14:28.705>just <00:14:28.880>great. <00:14:29.055>I <00:14:29.230>mean <00:14:29.405>this <00:14:29.580>can <00:14:29.755>become

366
00:14:30.805 --> 00:14:31.885
<00:14:30.805>entirely <00:14:31.777>non-deterministic.

367
00:14:32.185 --> 00:14:35.485
<00:14:32.185>The <00:14:32.312>only <00:14:32.439>way <00:14:32.566>to <00:14:32.694>figure <00:14:32.821>out <00:14:32.948>what <00:14:33.075>this <00:14:33.203>variable <00:14:33.330>will <00:14:33.457>now <00:14:33.584>point

368
00:14:35.485 --> 00:14:36.925
<00:14:35.485>to <00:14:35.744>is <00:14:36.003>to <00:14:36.262>run <00:14:36.521>the <00:14:36.781>program.

369
00:14:37.185 --> 00:14:39.245
<00:14:37.185>Static <00:14:37.535>analysis <00:14:37.885>is <00:14:38.234>entirely <00:14:38.584>impossible.

370
00:14:39.545 --> 00:14:42.725
<00:14:39.545>And <00:14:39.685>even <00:14:39.824>if <00:14:39.964>you <00:14:40.104>have <00:14:40.245>some <00:14:40.385>super <00:14:40.525>smart <00:14:40.665>AI <00:14:40.805>powered <00:14:40.944>static

371
00:14:43.045 --> 00:14:45.285
<00:14:43.045>analysis <00:14:43.245>tool, <00:14:43.444>you <00:14:43.645>can <00:14:43.844>still <00:14:44.045>nest <00:14:44.245>with <00:14:44.444>statements

372
00:14:46.265 --> 00:14:48.405
<00:14:46.265>to <00:14:46.498>at <00:14:46.731>least <00:14:46.965>make <00:14:47.198>it <00:14:47.431>really <00:14:47.665>expensive

373
00:14:48.405 --> 00:14:49.405
<00:14:48.405>to <00:14:48.704>analyze <00:14:49.005>this <00:14:49.305>program.

374
00:14:49.865 --> 00:14:52.045
<00:14:49.865>And <00:14:50.040>this <00:14:50.215>is <00:14:50.390>just <00:14:50.565>great. <00:14:50.740>This <00:14:50.915>is <00:14:51.090>still <00:14:51.265>possible.

375
00:14:52.045 --> 00:14:53.405
<00:14:52.045>You <00:14:52.289>can <00:14:52.534>write <00:14:52.779>this <00:14:53.024>code <00:14:53.269>today

376
00:14:53.705 --> 00:14:56.925
<00:14:53.705>and <00:14:53.860>then <00:14:54.016>you <00:14:54.171>accept <00:14:54.327>essentially <00:14:54.482>use <00:14:54.638>the <00:14:54.793>reason <00:14:54.949>why <00:14:55.105>your

377
00:14:56.925 --> 00:14:57.925
<00:14:56.925>JavaScript <00:14:57.224>is <00:14:57.525>so <00:14:57.824>slow.

378
00:14:58.315 --> 00:15:00.805
<00:14:58.315>This <00:14:58.515>guy, <00:14:58.715>the <00:14:58.915>width <00:14:59.115>statement <00:14:59.315>is <00:14:59.515>still <00:14:59.715>specified.

379
00:15:00.985 --> 00:15:02.765
<00:15:00.985>It <00:15:01.218>has <00:15:01.451>a <00:15:01.685>red <00:15:01.918>background <00:15:02.151>in <00:15:02.385>the

380
00:15:02.965 --> 00:15:04.485
<00:15:02.965>specifications, <00:15:03.238>but <00:15:03.512>it's <00:15:03.785>still <00:15:04.059>in <00:15:04.333>there.

381
00:15:04.645 --> 00:15:06.485
<00:15:04.645>Browsers <00:15:04.925>and <00:15:05.204>all <00:15:05.485>other <00:15:05.765>JavaScript <00:15:06.045>engines

382
00:15:06.595 --> 00:15:07.685
<00:15:06.595>have <00:15:06.922>to <00:15:07.249>implement <00:15:07.575>this.

383
00:15:07.685 --> 00:15:09.405
<00:15:07.685>And <00:15:07.918>because <00:15:08.151>they <00:15:08.385>have <00:15:08.618>to <00:15:08.851>implement <00:15:09.084>this,

384
00:15:09.515 --> 00:15:11.285
<00:15:09.515>they <00:15:09.795>cannot <00:15:10.074>use <00:15:10.355>all <00:15:10.635>the <00:15:10.915>optimizations.

385
00:15:12.955 --> 00:15:15.165
<00:15:12.955>This <00:15:13.155>is <00:15:13.355>the <00:15:13.555>web <00:15:13.755>platform <00:15:13.955>at <00:15:14.155>its <00:15:14.355>best

386
00:15:15.235 --> 00:15:18.845
<00:15:15.235>because <00:15:15.362>if <00:15:15.489>you <00:15:15.616>think <00:15:15.744>about <00:15:15.871>it, <00:15:15.998>what <00:15:16.125>is <00:15:16.253>a <00:15:16.380>web <00:15:16.507>browser's <00:15:16.635>first

387
00:15:18.865 --> 00:15:19.965
<00:15:18.865>and <00:15:19.360>foremost <00:15:19.855>job?

388
00:15:20.145 --> 00:15:22.525
<00:15:20.145>What's <00:15:20.345>a <00:15:20.545>web <00:15:20.745>browser <00:15:20.944>browser <00:15:21.145>supposed <00:15:21.345>to <00:15:21.545>do?

389
00:15:22.745 --> 00:15:24.005
<00:15:22.745>Is <00:15:22.971>it <00:15:23.198>supposed <00:15:23.425>to <00:15:23.652>be <00:15:23.879>safe?

390
00:15:24.185 --> 00:15:26.045
<00:15:24.185>Secure <00:15:24.464>load <00:15:24.744>webpage <00:15:25.025>is <00:15:25.305>really <00:15:25.584>fast.

391
00:15:26.355 --> 00:15:28.205
<00:15:26.355>Nope, <00:15:26.705>this <00:15:27.055>is <00:15:27.405>all <00:15:27.755>secondary.

392
00:15:28.465 --> 00:15:30.565
<00:15:28.465>The <00:15:28.640>only <00:15:28.815>job <00:15:28.990>a <00:15:29.165>web <00:15:29.340>browser <00:15:29.515>really <00:15:29.690>has <00:15:29.865>is

393
00:15:30.565 --> 00:15:32.165
<00:15:30.565>to <00:15:31.265>display <00:15:31.965>webpages.

394
00:15:32.345 --> 00:15:35.805
<00:15:32.345>And <00:15:32.520>by <00:15:32.695>webpages <00:15:32.870>I <00:15:33.045>mean <00:15:33.220>every <00:15:33.395>webpage, <00:15:33.570>every <00:15:33.745>webpage

395
00:15:35.805 --> 00:15:38.965
<00:15:35.805>that <00:15:35.979>exists <00:15:36.155>that <00:15:36.329>has <00:15:36.505>ever <00:15:36.680>existed, <00:15:36.854>your <00:15:37.030>worst, <00:15:37.204>um,

396
00:15:39.045 --> 00:15:40.885
<00:15:39.045>I <00:15:39.395>don't <00:15:39.745>know, <00:15:40.094>MySpace <00:15:40.444>nightmare

397
00:15:40.885 --> 00:15:43.645
<00:15:40.885>that <00:15:41.060>you've <00:15:41.235>crafted <00:15:41.410>back <00:15:41.585>in <00:15:41.760>the <00:15:41.935>day <00:15:42.110>still <00:15:42.285>needs

398
00:15:43.645 --> 00:15:45.685
<00:15:43.645>to <00:15:43.925>be <00:15:44.204>supported <00:15:44.485>by <00:15:44.765>today's <00:15:45.045>browsers

399
00:15:45.905 --> 00:15:49.285
<00:15:45.905>and <00:15:46.060>to <00:15:46.216>make <00:15:46.371>this <00:15:46.527>possible <00:15:46.682>browsers <00:15:46.838>support <00:15:46.993>every <00:15:47.149>old <00:15:47.305>feature

400
00:15:49.285 --> 00:15:50.525
<00:15:49.285>that <00:15:49.564>that <00:15:49.843>has <00:15:50.122>ever <00:15:50.401>existed.

401
00:15:51.055 --> 00:15:52.525
<00:15:51.055>Everything <00:15:51.716>still <00:15:52.377>works.

402
00:15:52.825 --> 00:15:55.005
<00:15:52.825>And <00:15:52.980>this <00:15:53.136>is <00:15:53.291>why <00:15:53.447>the <00:15:53.602>web <00:15:53.758>platform <00:15:53.913>is <00:15:54.069>so <00:15:54.225>nice

403
00:15:55.025 --> 00:15:56.165
<00:15:55.025>and <00:15:55.367>stable <00:15:55.709>today, <00:15:56.050>right?

404
00:15:56.955 --> 00:15:59.125
<00:15:56.955>Well, <00:15:57.095>of <00:15:57.235>course <00:15:57.375>you <00:15:57.515>can <00:15:57.655>install <00:15:57.795>a <00:15:57.935>whole <00:15:58.075>bunch <00:15:58.215>of <00:15:58.355>frameworks

405
00:15:59.125 --> 00:16:01.125
<00:15:59.125>and <00:15:59.358>libraries <00:15:59.591>to <00:15:59.825>make <00:16:00.058>this <00:16:00.291>only <00:16:00.525>thing

406
00:16:01.125 --> 00:16:02.445
<00:16:01.125>that <00:16:01.294>the <00:16:01.464>web <00:16:01.634>platform <00:16:01.803>is <00:16:01.973>really <00:16:02.143>good <00:16:02.313>at.

407
00:16:02.445 --> 00:16:05.045
<00:16:02.445>Backwards <00:16:02.795>compatibility <00:16:03.145>a <00:16:03.495>break <00:16:03.845>again,

408
00:16:05.345 --> 00:16:08.325
<00:16:05.345>but <00:16:05.485>you <00:16:05.625>also, <00:16:05.765>you <00:16:05.905>know, <00:16:06.045>can <00:16:06.185>choose <00:16:06.325>not <00:16:06.465>to <00:16:06.605>do <00:16:06.745>this.

409
00:16:08.705 --> 00:16:09.805
<00:16:08.705>But <00:16:08.952>this <00:16:09.200>is <00:16:09.447>really <00:16:09.694>great

410
00:16:09.805 --> 00:16:10.805
<00:16:09.805>because <00:16:10.255>this, <00:16:10.704>um,

411
00:16:11.035 --> 00:16:13.845
<00:16:11.035>imposes <00:16:11.314>some <00:16:11.594>very <00:16:11.875>interesting <00:16:12.155>constraints <00:16:12.435>on

412
00:16:13.895 --> 00:16:15.485
<00:16:13.895>JavaScript <00:16:14.595>engine <00:16:15.295>development.

413
00:16:15.745 --> 00:16:17.245
<00:16:15.745>You <00:16:16.082>cannot <00:16:16.420>break <00:16:16.757>existing <00:16:17.095>code,

414
00:16:17.245 --> 00:16:18.765
<00:16:17.245>you <00:16:17.587>can <00:16:17.929>never <00:16:18.271>deprecate <00:16:18.613>anything.

415
00:16:18.765 --> 00:16:21.165
<00:16:18.765>You <00:16:18.939>can <00:16:19.115>never <00:16:19.290>remove <00:16:19.465>anything <00:16:19.640>from <00:16:19.814>a <00:16:19.990>JavaScript <00:16:20.165>engine

416
00:16:21.165 --> 00:16:22.285
<00:16:21.165>or <00:16:21.416>a <00:16:21.669>browser <00:16:21.920>in <00:16:22.173>general.

417
00:16:22.625 --> 00:16:25.365
<00:16:22.625>And <00:16:22.800>this <00:16:22.975>also <00:16:23.150>means <00:16:23.325>that <00:16:23.500>you <00:16:23.675>cannot <00:16:23.850>just <00:16:24.025>introduce

418
00:16:25.545 --> 00:16:26.805
<00:16:25.545>new <00:16:25.923>features <00:16:26.300>to <00:16:26.679>JavaScript.

419
00:16:26.985 --> 00:16:29.285
<00:16:26.985>You <00:16:27.160>cannot <00:16:27.335>introduce <00:16:27.510>a <00:16:27.685>new <00:16:27.860>keyword <00:16:28.035>to <00:16:28.210>the <00:16:28.385>language

420
00:16:29.285 --> 00:16:32.045
<00:16:29.285>because <00:16:29.425>you <00:16:29.564>can <00:16:29.704>only <00:16:29.844>introduce <00:16:29.985>a <00:16:30.125>new <00:16:30.265>keyword <00:16:30.405>if <00:16:30.545>you <00:16:30.685>know

421
00:16:32.155 --> 00:16:35.205
<00:16:32.155>that <00:16:32.295>this <00:16:32.435>specific <00:16:32.574>keyword <00:16:32.714>has <00:16:32.855>never <00:16:32.995>been <00:16:33.135>used <00:16:33.275>as <00:16:33.415>a <00:16:33.555>variable

422
00:16:35.225 --> 00:16:37.285
<00:16:35.225>by <00:16:35.505>anyone <00:16:35.785>on <00:16:36.065>this <00:16:36.345>planet <00:16:36.625>ever.

423
00:16:38.935 --> 00:16:40.445
<00:16:38.935>Isn't <00:16:39.274>this <00:16:39.614>an <00:16:39.954>interesting <00:16:40.294>constraint?

424
00:16:41.195 --> 00:16:43.285
<00:16:41.195>Okay, <00:16:41.395>now <00:16:41.595>you <00:16:41.795>might <00:16:41.995>say, <00:16:42.195>wait <00:16:42.395>a <00:16:42.595>minute,

425
00:16:43.745 --> 00:16:46.045
<00:16:43.745>my <00:16:43.978>lift <00:16:44.211>experience <00:16:44.445>tells <00:16:44.678>me <00:16:44.911>something <00:16:45.145>else.

426
00:16:46.185 --> 00:16:49.085
<00:16:46.185>My <00:16:46.418>lift <00:16:46.651>experience <00:16:46.885>through <00:16:47.118>JavaScript <00:16:47.351>tells <00:16:47.584>me

427
00:16:49.195 --> 00:16:51.765
<00:16:49.195>that <00:16:49.370>I <00:16:49.545>have <00:16:49.720>seen <00:16:49.895>the <00:16:50.070>introduction <00:16:50.245>of <00:16:50.420>new <00:16:50.595>keywords.

428
00:16:52.465 --> 00:16:54.645
<00:16:52.465>But <00:16:52.665>have <00:16:52.865>you <00:16:53.065>really, <00:16:53.265>let's <00:16:53.465>think <00:16:53.665>about <00:16:53.865>this.

429
00:16:54.945 --> 00:16:57.645
<00:16:54.945>The <00:16:55.085>four <00:16:55.225>off <00:16:55.365>loop <00:16:55.505>in <00:16:55.645>line <00:16:55.785>three <00:16:55.925>is <00:16:56.065>kind <00:16:56.205>of <00:16:56.345>new,

430
00:16:58.585 --> 00:16:59.765
<00:16:58.585>hasn't <00:16:58.797>been <00:16:59.009>there <00:16:59.222>from <00:16:59.434>the <00:16:59.646>beginning.

431
00:16:59.835 --> 00:17:02.365
<00:16:59.835>Back <00:16:59.962>in <00:17:00.089>the <00:17:00.216>day <00:17:00.344>we <00:17:00.471>had <00:17:00.598>to <00:17:00.725>do <00:17:00.853>regular <00:17:00.980>for <00:17:01.107>loops <00:17:01.235>like

432
00:17:02.365 --> 00:17:05.125
<00:17:02.365>with <00:17:02.645>counter <00:17:02.925>variables <00:17:03.205>and <00:17:03.485>other <00:17:03.765>bism.

433
00:17:05.545 --> 00:17:07.445
<00:17:05.545>But <00:17:05.825>the <00:17:06.105>off <00:17:06.385>keyword <00:17:06.665>is <00:17:06.945>actually,

434
00:17:08.165 --> 00:17:10.005
<00:17:08.165>I <00:17:08.398>admit <00:17:08.631>a <00:17:08.865>keyword <00:17:09.098>and <00:17:09.331>it's <00:17:09.565>new.

435
00:17:10.435 --> 00:17:12.605
<00:17:10.435>Does <00:17:10.714>this <00:17:10.994>mean <00:17:11.274>that <00:17:11.554>it's <00:17:11.835>impossible

436
00:17:12.705 --> 00:17:14.325
<00:17:12.704>to <00:17:12.984>create <00:17:13.264>a <00:17:13.544>variable <00:17:13.824>called <00:17:14.105>off?

437
00:17:14.545 --> 00:17:16.805
<00:17:14.545>Is <00:17:14.700>it <00:17:14.856>true <00:17:15.011>that <00:17:15.167>nobody <00:17:15.322>on <00:17:15.478>this <00:17:15.633>planet <00:17:15.789>has <00:17:15.945>ever

438
00:17:16.805 --> 00:17:17.885
<00:17:16.805>created <00:17:17.129>a <00:17:17.453>variable <00:17:17.777>off?

439
00:17:17.985 --> 00:17:19.845
<00:17:17.984>And <00:17:18.334>the <00:17:18.685>answer <00:17:19.034>is <00:17:19.385>no.

440
00:17:20.035 --> 00:17:21.325
<00:17:20.035>Both <00:17:20.422>are <00:17:20.809>still <00:17:21.196>possible

441
00:17:21.475 --> 00:17:26.085
<00:17:21.474>because <00:17:21.630>office <00:17:21.786>only <00:17:21.941>a <00:17:22.097>keyword <00:17:22.252>at <00:17:22.408>this <00:17:22.563>specific <00:17:22.719>PO <00:17:22.875>position

442
00:17:26.305 --> 00:17:29.285
<00:17:26.305>in <00:17:26.421>the <00:17:26.538>header <00:17:26.655>of <00:17:26.771>a <00:17:26.888>four <00:17:27.005>off <00:17:27.121>loop <00:17:27.238>only <00:17:27.355>in <00:17:27.471>this <00:17:27.588>position <00:17:27.705>is

443
00:17:29.285 --> 00:17:31.165
<00:17:29.285>of <00:17:29.518>a <00:17:29.751>keyword <00:17:29.985>in <00:17:30.218>every <00:17:30.451>other <00:17:30.685>position.

444
00:17:31.235 --> 00:17:33.125
<00:17:31.235>It's <00:17:31.435>just <00:17:31.635>an <00:17:31.834>identifier <00:17:32.034>that <00:17:32.235>you <00:17:32.435>can <00:17:32.635>use

445
00:17:33.125 --> 00:17:35.325
<00:17:33.125>for <00:17:33.300>your <00:17:33.475>variable <00:17:33.650>names, <00:17:33.825>classes, <00:17:34.000>functions, <00:17:34.175>what <00:17:34.350>have <00:17:34.525>you.

446
00:17:36.075 --> 00:17:37.765
<00:17:36.075>Okay, <00:17:36.541>this <00:17:37.008>is <00:17:37.475>interesting.

447
00:17:38.315 --> 00:17:41.685
<00:17:38.315>Does <00:17:38.470>this <00:17:38.626>mean <00:17:38.781>that <00:17:38.937>we <00:17:39.092>can <00:17:39.248>rename <00:17:39.403>value <00:17:39.559>to <00:17:39.715>off?

448
00:17:42.225 --> 00:17:44.525
<00:17:42.225>And <00:17:42.399>the <00:17:42.574>answer <00:17:42.750>of <00:17:42.925>course <00:17:43.100>is <00:17:43.274>sure <00:17:43.449>we <00:17:43.625>can

449
00:17:44.595 --> 00:17:47.605
<00:17:44.595>because <00:17:44.735>only <00:17:44.875>in <00:17:45.015>the <00:17:45.155>middle <00:17:45.295>position <00:17:45.435>is <00:17:45.575>this <00:17:45.715>guy <00:17:45.855>a <00:17:45.995>keyword

450
00:17:47.605 --> 00:17:48.805
<00:17:47.605>and <00:17:47.875>in <00:17:48.145>no <00:17:48.415>other <00:17:48.685>position.

451
00:17:49.955 --> 00:17:52.325
<00:17:49.955>This <00:17:50.155>is <00:17:50.355>neat. <00:17:50.554>Don't <00:17:50.754>write <00:17:50.955>a <00:17:51.155>JavaScript <00:17:51.355>syntax

452
00:17:52.325 --> 00:17:53.525
<00:17:52.325>highlighter, <00:17:52.541>ask <00:17:52.757>me <00:17:52.973>how <00:17:53.189>I <00:17:53.405>know.

453
00:17:54.105 --> 00:17:57.325
<00:17:54.105>Um, <00:17:54.260>the <00:17:54.416>next <00:17:54.571>question <00:17:54.727>of <00:17:54.882>course <00:17:55.038>is <00:17:55.193>what <00:17:55.349>about <00:17:55.505>list?

454
00:17:57.485 --> 00:17:58.925
<00:17:57.485>I <00:17:57.670>mean <00:17:57.855>this <00:17:58.040>is <00:17:58.225>also <00:17:58.410>a <00:17:58.595>variable <00:17:58.781>name.

455
00:17:59.145 --> 00:18:00.685
<00:17:59.145>Can <00:17:59.376>we <00:17:59.607>turn <00:17:59.838>this <00:18:00.069>also <00:18:00.300>into <00:18:00.531>off?

456
00:18:00.745 --> 00:18:02.285
<00:18:00.745>And <00:18:00.976>the <00:18:01.206>answer <00:18:01.437>is <00:18:01.669>sure <00:18:01.900>we <00:18:02.131>can.

457
00:18:02.425 --> 00:18:03.645
<00:18:02.425>The <00:18:02.699>for <00:18:02.974>off <00:18:03.248>loop <00:18:03.523>goes

458
00:18:03.645 --> 00:18:06.445
<00:18:03.645>to <00:18:03.772>the <00:18:03.899>array <00:18:04.026>in <00:18:04.154>this <00:18:04.281>case <00:18:04.408>calls <00:18:04.535>a <00:18:04.663>method <00:18:04.790>on <00:18:04.917>the <00:18:05.045>array,

459
00:18:06.555 --> 00:18:07.725
<00:18:06.555>gets <00:18:06.906>back <00:18:07.257>an <00:18:07.608>iterator

460
00:18:07.725 --> 00:18:09.925
<00:18:07.725>and <00:18:07.925>loops <00:18:08.125>over <00:18:08.324>the <00:18:08.524>iterator, <00:18:08.725>which <00:18:08.925>means <00:18:09.125>that

461
00:18:09.945 --> 00:18:11.685
<00:18:09.945>for <00:18:10.178>running <00:18:10.411>the <00:18:10.645>loop, <00:18:10.878>it's <00:18:11.111>not <00:18:11.345>necessary

462
00:18:11.905 --> 00:18:13.765
<00:18:11.905>to <00:18:12.138>have <00:18:12.371>list <00:18:12.605>point <00:18:12.838>to <00:18:13.071>the <00:18:13.305>array.

463
00:18:14.105 --> 00:18:16.125
<00:18:14.105>So <00:18:14.305>we <00:18:14.505>can <00:18:14.705>simply <00:18:14.905>rename <00:18:15.105>this <00:18:15.305>too <00:18:15.505>often

464
00:18:16.125 --> 00:18:17.925
<00:18:16.125>and <00:18:16.358>it <00:18:16.591>will <00:18:16.825>still <00:18:17.058>just <00:18:17.291>work <00:18:17.525>fine.

465
00:18:21.465 --> 00:18:23.485
<00:18:21.465>And <00:18:21.665>this <00:18:21.865>is <00:18:22.064>how <00:18:22.264>all <00:18:22.465>new <00:18:22.665>keywords <00:18:22.865>in

466
00:18:23.485 --> 00:18:24.725
<00:18:23.485>JavaScript <00:18:24.043>get <00:18:24.601>introduced.

467
00:18:24.905 --> 00:18:27.325
<00:18:24.905>If <00:18:25.080>you <00:18:25.254>ever <00:18:25.430>see <00:18:25.605>someone <00:18:25.780>introducing <00:18:25.955>a <00:18:26.129>new <00:18:26.305>keyword,

468
00:18:27.475 --> 00:18:30.845
<00:18:27.475>take <00:18:27.630>a <00:18:27.786>closer <00:18:27.941>look <00:18:28.097>if <00:18:28.252>this <00:18:28.408>really <00:18:28.563>is <00:18:28.719>a <00:18:28.875>keyword

469
00:18:31.025 --> 00:18:32.805
<00:18:31.025>or <00:18:31.305>just <00:18:31.585>a <00:18:31.865>very <00:18:32.145>context <00:18:32.425>sensitive,

470
00:18:32.805 --> 00:18:35.005
<00:18:32.805>very <00:18:33.085>specific <00:18:33.365>hack <00:18:33.645>into <00:18:33.925>the <00:18:34.205>language

471
00:18:35.185 --> 00:18:36.605
<00:18:35.185>to <00:18:35.504>make <00:18:35.824>something <00:18:36.143>possible <00:18:36.463>that

472
00:18:36.605 --> 00:18:37.925
<00:18:36.605>otherwise <00:18:37.001>wouldn't <00:18:37.397>be <00:18:37.793>possible.

473
00:18:38.225 --> 00:18:41.445
<00:18:38.225>If <00:18:38.352>you <00:18:38.479>notice <00:18:38.606>this, <00:18:38.734>if <00:18:38.861>you <00:18:38.988>keep <00:18:39.115>your <00:18:39.243>eye <00:18:39.370>out <00:18:39.497>for <00:18:39.625>context,

474
00:18:41.545 --> 00:18:42.645
<00:18:41.545>um, <00:18:42.040>sensitive <00:18:42.535>keywords,

475
00:18:42.825 --> 00:18:45.325
<00:18:42.825>you <00:18:43.000>will <00:18:43.175>see <00:18:43.350>them <00:18:43.525>all <00:18:43.700>over <00:18:43.875>the <00:18:44.050>place, <00:18:44.225>right?

476
00:18:51.105 --> 00:18:53.765
<00:18:51.105>Ah, <00:18:51.260>but <00:18:51.416>we <00:18:51.571>were <00:18:51.727>talking <00:18:51.882>about <00:18:52.038>the <00:18:52.193>Wist <00:18:52.349>statement <00:18:52.505>anyway.

477
00:18:53.905 --> 00:18:56.125
<00:18:53.905>Um, <00:18:54.105>the <00:18:54.305>Wist <00:18:54.504>statement <00:18:54.705>is <00:18:54.905>kind <00:18:55.105>of <00:18:55.305>garbage.

478
00:18:56.315 --> 00:18:57.805
<00:18:56.315>It's <00:18:56.506>a <00:18:56.698>bad <00:18:56.889>idea <00:18:57.081>from <00:18:57.272>the <00:18:57.464>middle <00:18:57.656>Ages.

479
00:18:57.865 --> 00:18:59.565
<00:18:57.865>Um, <00:18:58.331>this <00:18:58.798>just <00:18:59.265>serves

480
00:18:59.565 --> 00:19:01.805
<00:18:59.565>to <00:18:59.720>make <00:18:59.876>our <00:19:00.031>code <00:19:00.187>slower <00:19:00.342>than <00:19:00.498>it <00:19:00.653>needs <00:19:00.809>to <00:19:00.965>be.

481
00:19:02.205 --> 00:19:05.325
<00:19:02.205>I <00:19:02.345>mean, <00:19:02.485>it <00:19:02.625>doesn't <00:19:02.764>concern <00:19:02.905>us <00:19:03.044>much <00:19:03.185>in <00:19:03.324>our <00:19:03.465>nowadays, <00:19:03.605>uh,

482
00:19:05.325 --> 00:19:07.645
<00:19:05.325>modern <00:19:05.500>JavaScript <00:19:05.675>because <00:19:05.850>in <00:19:06.025>streak <00:19:06.200>mode <00:19:06.375>this <00:19:06.550>is <00:19:06.725>invalid,

483
00:19:07.745 --> 00:19:10.325
<00:19:07.745>but <00:19:07.945>it's <00:19:08.145>still <00:19:08.344>there <00:19:08.544>in <00:19:08.745>the <00:19:08.945>specification <00:19:09.145>making

484
00:19:10.325 --> 00:19:11.685
<00:19:10.325>everything <00:19:10.937>more <00:19:11.549>complicated.

485
00:19:11.785 --> 00:19:14.725
<00:19:11.785>It <00:19:11.940>still <00:19:12.096>exists <00:19:12.251>in <00:19:12.407>the <00:19:12.562>engines <00:19:12.718>making <00:19:12.873>your <00:19:13.029>code <00:19:13.185>slower.

486
00:19:15.185 --> 00:19:18.725
<00:19:15.185>Um, <00:19:15.360>and <00:19:15.534>it's <00:19:15.710>bad <00:19:15.885>shouldn't <00:19:16.060>exist, <00:19:16.235>but <00:19:16.409>it <00:19:16.585>does

487
00:19:18.785 --> 00:19:20.405
<00:19:18.785>and <00:19:19.018>it <00:19:19.251>will <00:19:19.485>exist <00:19:19.718>for <00:19:19.951>all <00:19:20.185>eternity.

488
00:19:20.985 --> 00:19:23.965
<00:19:20.985>Oh <00:19:21.218>my, <00:19:21.451>okay, <00:19:21.685>onto <00:19:21.918>the <00:19:22.151>next <00:19:22.385>feature.

489
00:19:25.905 --> 00:19:27.965
<00:19:25.905>Uh, <00:19:26.371>that's <00:19:26.838>not <00:19:27.305>JavaScript.

490
00:19:28.405 --> 00:19:29.925
<00:19:28.405>I <00:19:28.576>don't <00:19:28.747>know <00:19:28.918>what <00:19:29.089>this <00:19:29.260>does <00:19:29.431>in <00:19:29.601>this <00:19:29.773>presentation,

491
00:19:29.925 --> 00:19:32.565
<00:19:29.925>but <00:19:30.100>it's <00:19:30.274>interesting <00:19:30.450>nevertheless, <00:19:30.625>like <00:19:30.800>did <00:19:30.975>you <00:19:31.149>know <00:19:31.325>this?

492
00:19:32.665 --> 00:19:35.565
<00:19:32.665>Um, <00:19:32.820>they <00:19:32.976>have <00:19:33.131>their <00:19:33.287>own <00:19:33.442>common <00:19:33.598>currencies <00:19:33.753>down <00:19:33.909>there <00:19:34.065>in

493
00:19:35.565 --> 00:19:37.725
<00:19:35.565>Africa <00:19:35.692>and <00:19:35.819>they <00:19:35.946>are <00:19:36.074>even <00:19:36.201>doing <00:19:36.328>it <00:19:36.455>better <00:19:36.583>than <00:19:36.710>us <00:19:36.837>here <00:19:36.965>in

494
00:19:37.725 --> 00:19:40.245
<00:19:37.725>Europe <00:19:37.880>with <00:19:38.036>a <00:19:38.191>Europe <00:19:38.347>because <00:19:38.502>they <00:19:38.658>have <00:19:38.813>two <00:19:38.969>of <00:19:39.125>them.

495
00:19:40.745 --> 00:19:43.725
<00:19:40.745>Um, <00:19:40.945>this <00:19:41.145>is <00:19:41.344>just <00:19:41.544>interesting <00:19:41.745>currencies <00:19:41.945>in <00:19:42.145>Africa.

496
00:19:43.935 --> 00:19:46.365
<00:19:43.935>Don't <00:19:44.090>worry. <00:19:44.246>Um, <00:19:44.401>ignore <00:19:44.557>this, <00:19:44.712>this <00:19:44.868>won't <00:19:45.023>come <00:19:45.179>up <00:19:45.335>later.

497
00:19:46.785 --> 00:19:49.405
<00:19:46.785>Um, <00:19:46.925>what <00:19:47.065>I <00:19:47.205>actually <00:19:47.345>want <00:19:47.485>to <00:19:47.625>talk <00:19:47.765>about <00:19:47.905>is <00:19:48.045>pass <00:19:48.185>in,

498
00:19:49.755 --> 00:19:51.405
<00:19:49.755>pass <00:19:50.105>in <00:19:50.455>takes <00:19:50.805>the <00:19:51.155>string

499
00:19:51.705 --> 00:19:53.645
<00:19:51.705>and <00:19:51.938>extracts <00:19:52.171>an <00:19:52.405>integer <00:19:52.638>from <00:19:52.871>the <00:19:53.105>string.

500
00:19:53.645 --> 00:19:56.285
<00:19:53.645>We <00:19:53.845>probably <00:19:54.045>all <00:19:54.245>have <00:19:54.445>used <00:19:54.645>this <00:19:54.845>specific <00:19:55.045>function.

501
00:19:57.465 --> 00:20:00.205
<00:19:57.465>It <00:19:57.620>essentially <00:19:57.776>goes <00:19:57.931>through <00:19:58.087>the <00:19:58.242>string <00:19:58.398>from <00:19:58.553>left <00:19:58.709>to <00:19:58.865>right

502
00:20:00.345 --> 00:20:01.805
<00:20:00.345>and <00:20:00.607>stops <00:20:00.870>at <00:20:01.133>the <00:20:01.396>first <00:20:01.659>character.

503
00:20:01.805 --> 00:20:03.605
<00:20:01.805>That <00:20:02.038>cannot <00:20:02.271>be <00:20:02.505>interpreted <00:20:02.738>as <00:20:02.971>an <00:20:03.205>integer,

504
00:20:03.605 --> 00:20:06.365
<00:20:03.605>which <00:20:03.780>in <00:20:03.955>this <00:20:04.130>case <00:20:04.305>would <00:20:04.480>be <00:20:04.655>the <00:20:04.830>decimal <00:20:05.005>sign.

505
00:20:06.905 --> 00:20:11.165
<00:20:06.905>Um, <00:20:07.012>now <00:20:07.120>I <00:20:07.228>have <00:20:07.335>a <00:20:07.443>bunch <00:20:07.551>of <00:20:07.658>a <00:20:07.766>bunch <00:20:07.874>of <00:20:07.981>beef <00:20:08.089>with <00:20:08.197>pass <00:20:08.305>in,

506
00:20:11.565 --> 00:20:14.485
<00:20:11.565>starting <00:20:11.705>with <00:20:11.845>the, <00:20:11.985>the <00:20:12.125>fact <00:20:12.265>that <00:20:12.405>this <00:20:12.545>is <00:20:12.685>called <00:20:12.825>pass <00:20:12.965>in

507
00:20:14.585 --> 00:20:17.165
<00:20:14.585>and <00:20:14.760>we <00:20:14.935>have <00:20:15.110>an <00:20:15.285>integer <00:20:15.460>data <00:20:15.635>type <00:20:15.810>in <00:20:15.985>JavaScript,

508
00:20:17.385 --> 00:20:19.205
<00:20:17.385>but <00:20:17.618>this <00:20:17.851>returns <00:20:18.085>a <00:20:18.318>floating <00:20:18.551>point <00:20:18.785>number

509
00:20:19.615 --> 00:20:20.965
<00:20:19.615>which <00:20:20.020>kind <00:20:20.425>of <00:20:20.830>sucks.

510
00:20:21.085 --> 00:20:24.045
<00:20:21.085>I <00:20:21.225>mean <00:20:21.365>I <00:20:21.505>understand <00:20:21.645>why <00:20:21.785>it <00:20:21.925>does <00:20:22.065>this <00:20:22.205>simply <00:20:22.345>because <00:20:22.485>parts

511
00:20:24.065 --> 00:20:25.845
<00:20:24.065>and <00:20:24.345>existed <00:20:24.625>before <00:20:24.905>big <00:20:25.185>and <00:20:25.465>existed.

512
00:20:25.985 --> 00:20:29.525
<00:20:25.985>So <00:20:26.140>this <00:20:26.296>will <00:20:26.451>always <00:20:26.607>produce <00:20:26.762>floats, <00:20:26.918>which <00:20:27.073>kind <00:20:27.229>of <00:20:27.385>stinks,

513
00:20:29.525 --> 00:20:31.165
<00:20:29.525>but <00:20:29.725>you <00:20:29.925>know, <00:20:30.125>I <00:20:30.325>can <00:20:30.525>deal <00:20:30.725>with <00:20:30.925>it

514
00:20:31.585 --> 00:20:33.125
<00:20:31.585>and <00:20:31.816>it <00:20:32.047>also <00:20:32.278>works <00:20:32.509>if <00:20:32.740>I <00:20:32.971>want

515
00:20:33.125 --> 00:20:35.645
<00:20:33.125>to <00:20:33.358>exter <00:20:33.591>extract <00:20:33.825>zero <00:20:34.058>from <00:20:34.291>the <00:20:34.525>string.

516
00:20:35.965 --> 00:20:37.885
<00:20:35.965>I <00:20:36.105>don't <00:20:36.245>know <00:20:36.385>why <00:20:36.524>you <00:20:36.665>would <00:20:36.804>ask <00:20:36.945>if <00:20:37.084>it <00:20:37.225>is <00:20:37.365>able

517
00:20:37.885 --> 00:20:39.365
<00:20:37.885>to <00:20:38.107>extract <00:20:38.329>this <00:20:38.551>zero <00:20:38.773>from <00:20:38.995>a <00:20:39.217>string

518
00:20:39.365 --> 00:20:41.485
<00:20:39.365>because <00:20:39.598>it <00:20:39.831>obviously <00:20:40.065>can <00:20:40.298>do <00:20:40.531>this <00:20:40.765>job

519
00:20:42.905 --> 00:20:45.205
<00:20:42.905>now <00:20:43.080>it <00:20:43.254>can <00:20:43.430>do <00:20:43.605>more <00:20:43.780>than <00:20:43.955>just, <00:20:44.129>you <00:20:44.305>know,

520
00:20:45.435 --> 00:20:46.605
<00:20:45.435>deal <00:20:45.786>with <00:20:46.137>regular <00:20:46.488>numbers.

521
00:20:46.785 --> 00:20:49.885
<00:20:46.785>It <00:20:46.960>can <00:20:47.135>also <00:20:47.310>extract <00:20:47.485>numbers <00:20:47.660>written <00:20:47.835>in <00:20:48.010>hexa <00:20:48.185>decimal

522
00:20:49.885 --> 00:20:51.005
<00:20:49.885>because <00:20:50.137>of <00:20:50.389>course <00:20:50.641>it <00:20:50.893>can,

523
00:20:51.385 --> 00:20:53.165
<00:20:51.385>if <00:20:51.585>you <00:20:51.785>just <00:20:51.985>take <00:20:52.185>the <00:20:52.385>hexa <00:20:52.585>decimal <00:20:52.785>string

524
00:20:53.225 --> 00:20:55.765
<00:20:53.225>and <00:20:53.341>shove <00:20:53.458>it <00:20:53.574>into <00:20:53.691>pass <00:20:53.808>in, <00:20:53.925>this <00:20:54.041>will <00:20:54.158>result <00:20:54.274>in <00:20:54.391>not <00:20:54.508>a <00:20:54.625>number

525
00:20:55.795 --> 00:20:58.285
<00:20:55.795>because <00:20:55.995>it <00:20:56.195>thinks <00:20:56.395>it's <00:20:56.595>operating <00:20:56.795>in <00:20:56.995>base <00:20:57.195>10,

526
00:20:58.505 --> 00:21:00.605
<00:20:58.505>but <00:20:58.680>you <00:20:58.855>can <00:20:59.030>make <00:20:59.205>it <00:20:59.380>operate <00:20:59.555>in <00:20:59.730>base <00:20:59.905>16

527
00:21:00.745 --> 00:21:02.405
<00:21:00.745>by <00:21:01.024>simply <00:21:01.304>supplying <00:21:01.584>a <00:21:01.864>second <00:21:02.145>argument.

528
00:21:02.425 --> 00:21:05.605
<00:21:02.425>And <00:21:02.565>the <00:21:02.705>second <00:21:02.845>argument <00:21:02.985>in <00:21:03.125>this <00:21:03.264>case <00:21:03.405>being <00:21:03.544>16 <00:21:03.685>turns <00:21:03.825>this

529
00:21:05.805 --> 00:21:08.205
<00:21:05.805>thing <00:21:06.005>into <00:21:06.205>something <00:21:06.405>that <00:21:06.605>can <00:21:06.805>pass <00:21:07.005>hexa <00:21:07.205>decimal

530
00:21:08.295 --> 00:21:09.525
<00:21:08.295>makes <00:21:08.516>a <00:21:08.737>whole <00:21:08.959>bunch <00:21:09.180>of <00:21:09.402>sense.

531
00:21:10.105 --> 00:21:14.965
<00:21:10.105>Now, <00:21:10.221>if <00:21:10.338>I <00:21:10.455>need <00:21:10.571>to <00:21:10.688>supply <00:21:10.805>16 <00:21:10.921>to <00:21:11.038>make <00:21:11.155>it <00:21:11.271>do <00:21:11.388>base <00:21:11.505>16

532
00:21:15.345 --> 00:21:18.285
<00:21:15.345>and <00:21:15.472>if <00:21:15.599>it <00:21:15.726>returns <00:21:15.854>not <00:21:15.981>a <00:21:16.108>number, <00:21:16.235>if <00:21:16.363>I <00:21:16.490>don't <00:21:16.617>supply <00:21:16.745>16,

533
00:21:18.475 --> 00:21:20.485
<00:21:18.475>then <00:21:18.675>you <00:21:18.875>would <00:21:19.074>assume <00:21:19.274>that <00:21:19.475>the <00:21:19.675>default <00:21:19.875>value

534
00:21:20.505 --> 00:21:22.725
<00:21:20.505>for <00:21:20.738>this <00:21:20.971>second <00:21:21.205>argument <00:21:21.438>is <00:21:21.671>10, <00:21:21.905>right?

535
00:21:23.275 --> 00:21:25.805
<00:21:23.275>This <00:21:23.415>is <00:21:23.555>what <00:21:23.695>you <00:21:23.835>would <00:21:23.975>assume, <00:21:24.115>but <00:21:24.255>you <00:21:24.395>would <00:21:24.535>be <00:21:24.675>wrong

536
00:21:25.875 --> 00:21:28.245
<00:21:25.875>because <00:21:26.155>the <00:21:26.435>default <00:21:26.715>is <00:21:26.995>not <00:21:27.275>10.

537
00:21:28.385 --> 00:21:31.325
<00:21:28.385>The <00:21:28.540>default <00:21:28.696>is, <00:21:28.851>let's <00:21:29.007>guess <00:21:29.162>let's <00:21:29.318>look <00:21:29.473>at <00:21:29.629>the <00:21:29.785>string

538
00:21:31.545 --> 00:21:34.725
<00:21:31.545>and <00:21:31.700>if <00:21:31.856>the <00:21:32.011>string <00:21:32.167>starts <00:21:32.322>with <00:21:32.478>OX, <00:21:32.633>we <00:21:32.789>will <00:21:32.945>default

539
00:21:34.745 --> 00:21:36.405
<00:21:34.745>to <00:21:35.024>ex <00:21:35.304>decimal <00:21:35.584>to <00:21:35.864>base <00:21:36.145>16

540
00:21:36.625 --> 00:21:39.725
<00:21:36.625>and <00:21:36.765>only <00:21:36.905>in <00:21:37.045>other <00:21:37.185>cases <00:21:37.325>we <00:21:37.465>will <00:21:37.605>default <00:21:37.745>to <00:21:37.885>base <00:21:38.025>10.

541
00:21:40.795 --> 00:21:43.045
<00:21:40.795>Okay? <00:21:41.261>This <00:21:41.728>is <00:21:42.195>interesting.

542
00:21:43.285 --> 00:21:46.205
<00:21:43.285>I <00:21:43.412>mean, <00:21:43.539>I'm <00:21:43.666>sure <00:21:43.794>nobody <00:21:43.921>in <00:21:44.048>this <00:21:44.175>room <00:21:44.303>has <00:21:44.430>ever, <00:21:44.557>you <00:21:44.685>know,

543
00:21:46.205 --> 00:21:47.445
<00:21:46.205>taken <00:21:46.577>some <00:21:46.948>user <00:21:47.321>input

544
00:21:47.445 --> 00:21:49.765
<00:21:47.445>and <00:21:47.600>shoved <00:21:47.756>it <00:21:47.911>into, <00:21:48.067>pass <00:21:48.222>into <00:21:48.378>without <00:21:48.533>looking <00:21:48.689>at <00:21:48.845>it.

545
00:21:50.145 --> 00:21:52.085
<00:21:50.145>If <00:21:50.345>you <00:21:50.545>did, <00:21:50.745>maybe <00:21:50.945>you <00:21:51.145>want <00:21:51.345>to <00:21:51.545>reconsider,

546
00:21:52.305 --> 00:21:54.045
<00:21:52.305>but <00:21:52.585>there's <00:21:52.865>also <00:21:53.145>some <00:21:53.425>other <00:21:53.705>interesting,

547
00:21:54.225 --> 00:21:55.845
<00:21:54.225>um, <00:21:54.691>aspects <00:21:55.158>to <00:21:55.625>this.

548
00:21:56.235 --> 00:21:57.885
<00:21:56.235>Like <00:21:56.514>you <00:21:56.794>remember <00:21:57.074>the <00:21:57.354>funky <00:21:57.635>African

549
00:21:58.245 --> 00:21:59.285
<00:21:58.245>currencies <00:21:58.479>from <00:21:58.713>the <00:21:58.947>slide <00:21:59.181>before?

550
00:21:59.675 --> 00:22:01.405
<00:21:59.675>Yeah, <00:22:00.024>they <00:22:00.375>are <00:22:00.725>quite <00:22:01.075>new.

551
00:22:01.705 --> 00:22:06.245
<00:22:01.705>And <00:22:01.821>if <00:22:01.938>you <00:22:02.054>are <00:22:02.171>new <00:22:02.288>to <00:22:02.405>whatever <00:22:02.521>game <00:22:02.638>there <00:22:02.754>is, <00:22:02.871>then <00:22:02.988>you <00:22:03.105>need

552
00:22:06.245 --> 00:22:08.365
<00:22:06.245>to <00:22:06.372>scrape <00:22:06.499>the <00:22:06.626>bottom <00:22:06.754>of <00:22:06.881>the <00:22:07.008>barrel <00:22:07.135>when <00:22:07.263>it <00:22:07.390>comes <00:22:07.517>to <00:22:07.645>name.

553
00:22:08.385 --> 00:22:10.525
<00:22:08.385>You <00:22:08.560>all <00:22:08.735>know <00:22:08.910>this <00:22:09.085>from <00:22:09.260>deciding <00:22:09.435>on <00:22:09.610>a <00:22:09.785>domain

554
00:22:10.625 --> 00:22:11.965
<00:22:10.625>for <00:22:10.926>your <00:22:11.228>site <00:22:11.529>project, <00:22:11.831>right?

555
00:22:12.185 --> 00:22:13.325
<00:22:12.185>All <00:22:12.390>the <00:22:12.595>good <00:22:12.800>ones <00:22:13.005>are <00:22:13.211>taken.

556
00:22:13.545 --> 00:22:16.325
<00:22:13.545>And <00:22:13.700>this <00:22:13.856>is <00:22:14.011>also <00:22:14.167>true <00:22:14.322>for <00:22:14.478>three <00:22:14.633>letter <00:22:14.789>currency <00:22:14.945>codes.

557
00:22:16.625 --> 00:22:18.325
<00:22:16.625>The <00:22:16.905>good <00:22:17.185>ones <00:22:17.465>all <00:22:17.745>are <00:22:18.025>gone.

558
00:22:18.505 --> 00:22:21.805
<00:22:18.505>So <00:22:18.660>these <00:22:18.816>guys <00:22:18.971>have <00:22:19.127>to <00:22:19.282>default <00:22:19.438>to <00:22:19.593>whatever <00:22:19.749>is <00:22:19.905>left.

559
00:22:21.805 --> 00:22:25.005
<00:22:21.805>And <00:22:21.932>what <00:22:22.059>is <00:22:22.186>left <00:22:22.314>are <00:22:22.441>the <00:22:22.568>currency <00:22:22.695>codes <00:22:22.823>that <00:22:22.950>start <00:22:23.077>with <00:22:23.205>X,

560
00:22:26.775 --> 00:22:29.405
<00:22:26.775>which <00:22:26.915>is <00:22:27.055>bad <00:22:27.195>because <00:22:27.335>if <00:22:27.475>you <00:22:27.615>have <00:22:27.755>something <00:22:27.895>in <00:22:28.035>your <00:22:28.175>bank,

561
00:22:29.435 --> 00:22:32.645
<00:22:29.435>bank <00:22:29.575>account <00:22:29.715>then <00:22:29.855>pass <00:22:29.995>and <00:22:30.135>will <00:22:30.274>give <00:22:30.415>you <00:22:30.554>the <00:22:30.695>correct <00:22:30.835>answer.

562
00:22:32.905 --> 00:22:36.285
<00:22:32.905>But <00:22:33.045>if <00:22:33.185>you <00:22:33.325>have <00:22:33.465>nothing <00:22:33.605>in <00:22:33.745>your <00:22:33.885>bank <00:22:34.024>account, <00:22:34.165>then <00:22:34.305>pass

563
00:22:36.285 --> 00:22:38.565
<00:22:36.285>and <00:22:36.485>will <00:22:36.685>of <00:22:36.885>course <00:22:37.085>default <00:22:37.285>to <00:22:37.485>base <00:22:37.685>16

564
00:22:38.985 --> 00:22:40.525
<00:22:38.985>and <00:22:39.183>you <00:22:39.380>will <00:22:39.579>get <00:22:39.777>back <00:22:39.975>the <00:22:40.173>wrong <00:22:40.371>answer.

565
00:22:40.715 --> 00:22:44.725
<00:22:40.715>Talk <00:22:40.995>about <00:22:41.274>inflation. <00:22:41.554>My <00:22:41.834>god, <00:22:42.115>okay?

566
00:22:45.065 --> 00:22:46.245
<00:22:45.065>Um, <00:22:45.419>this <00:22:45.773>is <00:22:46.127>bad,

567
00:22:46.745 --> 00:22:50.085
<00:22:46.745>but <00:22:46.872>this <00:22:46.999>is <00:22:47.126>even <00:22:47.254>worse <00:22:47.381>than <00:22:47.508>it, <00:22:47.635>uh, <00:22:47.763>seems <00:22:47.890>on <00:22:48.017>its <00:22:48.145>face

568
00:22:50.395 --> 00:22:54.725
<00:22:50.395>because <00:22:50.628>this <00:22:50.861>function <00:22:51.095>could <00:22:51.328>have <00:22:51.561>been <00:22:51.795>repaired.

569
00:22:54.755 --> 00:22:57.485
<00:22:54.755>Something <00:22:55.035>that <00:22:55.315>is <00:22:55.595>usually <00:22:55.875>entirely <00:22:56.155>impossible.

570
00:22:57.505 --> 00:22:59.205
<00:22:57.505>You <00:22:57.785>cannot <00:22:58.065>repair <00:22:58.345>anything <00:22:58.625>in <00:22:58.905>JavaScript

571
00:22:59.205 --> 00:23:01.805
<00:22:59.205>because <00:22:59.485>repairing <00:22:59.764>features, <00:23:00.044>making <00:23:00.324>things <00:23:00.605>better,

572
00:23:02.025 --> 00:23:04.485
<00:23:02.025>breaks <00:23:02.225>existing <00:23:02.425>code <00:23:02.625>and <00:23:02.825>we <00:23:03.025>can't <00:23:03.225>have <00:23:03.425>this,

573
00:23:04.785 --> 00:23:06.485
<00:23:04.785>but <00:23:05.065>pastin <00:23:05.345>could <00:23:05.625>have <00:23:05.905>been <00:23:06.185>repaired.

574
00:23:06.835 --> 00:23:10.005
<00:23:06.835>Have <00:23:06.962>you <00:23:07.089>ever <00:23:07.216>used <00:23:07.344>is <00:23:07.471>n <00:23:07.598>this <00:23:07.725>is <00:23:07.853>a <00:23:07.980>nice <00:23:08.107>old <00:23:08.235>function

575
00:23:10.155 --> 00:23:12.005
<00:23:10.155>that <00:23:10.355>will <00:23:10.555>tell <00:23:10.754>you <00:23:10.955>if <00:23:11.155>the <00:23:11.355>value <00:23:11.555>yet

576
00:23:12.005 --> 00:23:13.805
<00:23:12.005>that <00:23:12.205>you <00:23:12.405>put <00:23:12.605>in <00:23:12.805>is <00:23:13.005>not <00:23:13.205>a <00:23:13.405>number.

577
00:23:13.985 --> 00:23:15.605
<00:23:13.985>So <00:23:14.218>42 <00:23:14.451>is <00:23:14.685>not, <00:23:14.918>not <00:23:15.151>a <00:23:15.385>number.

578
00:23:16.465 --> 00:23:18.765
<00:23:16.465>So <00:23:16.592>you <00:23:16.719>get <00:23:16.846>fault, <00:23:16.974>but <00:23:17.101>not <00:23:17.228>a <00:23:17.355>number <00:23:17.483>is <00:23:17.610>not <00:23:17.737>a <00:23:17.865>number.

579
00:23:18.945 --> 00:23:21.565
<00:23:18.945>So <00:23:19.100>you <00:23:19.256>get <00:23:19.411>true. <00:23:19.567>Now <00:23:19.722>let <00:23:19.878>me <00:23:20.033>ask <00:23:20.189>you <00:23:20.345>this.

580
00:23:22.225 --> 00:23:24.125
<00:23:22.225>Is <00:23:22.458>the <00:23:22.691>string <00:23:22.925>X <00:23:23.158>not <00:23:23.391>a <00:23:23.625>number?

581
00:23:26.765 --> 00:23:29.045
<00:23:26.765>I <00:23:27.045>mean <00:23:27.325>it's <00:23:27.605>not <00:23:27.885>a <00:23:28.165>number,

582
00:23:29.065 --> 00:23:31.005
<00:23:29.065>but <00:23:29.205>it's <00:23:29.345>not, <00:23:29.485>not <00:23:29.625>a <00:23:29.765>number <00:23:29.905>if <00:23:30.045>you <00:23:30.185>catch <00:23:30.325>my <00:23:30.465>drift.

583
00:23:31.665 --> 00:23:35.325
<00:23:31.665>But <00:23:31.805>what <00:23:31.945>this <00:23:32.085>nan <00:23:32.225>will <00:23:32.365>do <00:23:32.504>is <00:23:32.645>it'll <00:23:32.784>take <00:23:32.925>the <00:23:33.065>input

584
00:23:35.585 --> 00:23:38.405
<00:23:35.585>and <00:23:35.740>basically <00:23:35.896>try <00:23:36.051>to <00:23:36.207>turn <00:23:36.362>it <00:23:36.518>into <00:23:36.673>not <00:23:36.829>a <00:23:36.985>number,

585
00:23:38.495 --> 00:23:40.845
<00:23:38.495>which <00:23:38.695>using <00:23:38.895>the <00:23:39.094>string <00:23:39.294>X <00:23:39.495>is <00:23:39.695>entirely <00:23:39.895>possible.

586
00:23:41.025 --> 00:23:44.005
<00:23:41.025>So <00:23:41.180>this <00:23:41.336>will <00:23:41.491>return <00:23:41.647>true, <00:23:41.802>which <00:23:41.958>is <00:23:42.113>kind <00:23:42.269>of <00:23:42.425>true.

587
00:23:44.205 --> 00:23:46.205
<00:23:44.205>I <00:23:44.321>mean <00:23:44.438>X <00:23:44.554>is <00:23:44.671>not <00:23:44.788>a <00:23:44.905>number, <00:23:45.021>but <00:23:45.138>it's <00:23:45.254>not <00:23:45.371>not <00:23:45.488>a <00:23:45.605>number.

588
00:23:46.305 --> 00:23:47.885
<00:23:46.305>So <00:23:46.538>in <00:23:46.771>my <00:23:47.005>mind <00:23:47.238>this <00:23:47.471>is <00:23:47.705>false.

589
00:23:48.145 --> 00:23:51.285
<00:23:48.145>And <00:23:48.320>the <00:23:48.495>ecma <00:23:48.670>script <00:23:48.845>specifications <00:23:49.020>actually <00:23:49.195>agree <00:23:49.370>with <00:23:49.545>me.

590
00:23:51.635 --> 00:23:55.885
<00:23:51.635>They <00:23:51.762>created <00:23:51.889>a <00:23:52.016>new <00:23:52.144>version <00:23:52.271>of <00:23:52.398>is <00:23:52.525>n <00:23:52.653>called <00:23:52.780>number <00:23:52.907>is <00:23:53.035>n,

591
00:23:56.055 --> 00:23:58.405
<00:23:56.055>which <00:23:56.288>is <00:23:56.521>essentially <00:23:56.755>the <00:23:56.988>same <00:23:57.221>function <00:23:57.455>just

592
00:23:58.425 --> 00:24:01.165
<00:23:58.425>as <00:23:58.552>a <00:23:58.679>static <00:23:58.806>method <00:23:58.934>on <00:23:59.061>the <00:23:59.188>number <00:23:59.315>class <00:23:59.443>does <00:23:59.570>the <00:23:59.697>exactly <00:23:59.825>same

593
00:24:01.165 --> 00:24:04.205
<00:24:01.165>thing, <00:24:01.398>but <00:24:01.631>it <00:24:01.865>has <00:24:02.098>been <00:24:02.331>repaired, <00:24:02.565>right?

594
00:24:04.795 --> 00:24:07.205
<00:24:04.795>This <00:24:04.950>is, <00:24:05.106>this <00:24:05.261>is <00:24:05.417>how <00:24:05.572>you <00:24:05.728>advance <00:24:05.883>stuff <00:24:06.039>in <00:24:06.195>JavaScript.

595
00:24:07.345 --> 00:24:08.485
<00:24:07.345>You <00:24:07.687>cannot <00:24:08.029>repair <00:24:08.370>things,

596
00:24:08.505 --> 00:24:10.245
<00:24:08.505>you <00:24:08.738>can <00:24:08.971>only <00:24:09.205>add <00:24:09.438>to <00:24:09.671>the <00:24:09.905>specification.

597
00:24:10.425 --> 00:24:12.605
<00:24:10.425>You <00:24:10.580>can <00:24:10.736>create <00:24:10.891>new <00:24:11.047>and <00:24:11.202>better <00:24:11.358>ways <00:24:11.513>to <00:24:11.669>do <00:24:11.825>things,

598
00:24:12.625 --> 00:24:15.125
<00:24:12.625>but <00:24:12.780>the <00:24:12.936>old <00:24:13.091>stuff <00:24:13.247>will <00:24:13.402>keep <00:24:13.558>working <00:24:13.713>for <00:24:13.869>all <00:24:14.025>eternity.

599
00:24:15.315 --> 00:24:17.005
<00:24:15.315>It's <00:24:15.595>kind <00:24:15.875>of <00:24:16.155>blockchain <00:24:16.435>like, <00:24:16.715>right?

600
00:24:17.025 --> 00:24:19.285
<00:24:17.025>You <00:24:17.165>just <00:24:17.305>depend <00:24:17.445>stuff <00:24:17.585>and <00:24:17.725>it <00:24:17.865>will <00:24:18.005>get <00:24:18.145>better <00:24:18.285>over <00:24:18.425>time.

601
00:24:19.345 --> 00:24:20.445
<00:24:19.345>At <00:24:19.543>least <00:24:19.741>this <00:24:19.939>is <00:24:20.137>the <00:24:20.335>idea.

602
00:24:20.985 --> 00:24:24.245
<00:24:20.985>Now, <00:24:21.159>this <00:24:21.334>has <00:24:21.510>been <00:24:21.685>done <00:24:21.860>with <00:24:22.034>all <00:24:22.209>number <00:24:22.385>functions.

603
00:24:24.245 --> 00:24:27.405
<00:24:24.245>Number <00:24:24.385>is <00:24:24.524>nan <00:24:24.665>and <00:24:24.804>number <00:24:24.945>is <00:24:25.084>finite <00:24:25.225>and <00:24:25.364>what <00:24:25.504>have <00:24:25.645>you.

604
00:24:27.515 --> 00:24:28.805
<00:24:27.515>They <00:24:27.902>are <00:24:28.289>all <00:24:28.676>improved.

605
00:24:28.945 --> 00:24:31.685
<00:24:28.945>If <00:24:29.085>you <00:24:29.225>use <00:24:29.365>the <00:24:29.504>variant <00:24:29.645>that's <00:24:29.784>available <00:24:29.925>on <00:24:30.064>the <00:24:30.205>number <00:24:30.345>class.

606
00:24:32.265 --> 00:24:35.405
<00:24:32.265>Now, <00:24:32.545>does, <00:24:32.825>um, <00:24:33.105>pass <00:24:33.385>in <00:24:33.665>which

607
00:24:35.585 --> 00:24:37.005
<00:24:35.585>as <00:24:35.840>we've <00:24:36.096>seen <00:24:36.351>is <00:24:36.607>totally <00:24:36.863>broken,

608
00:24:37.355 --> 00:24:39.725
<00:24:37.355>also <00:24:37.635>exist <00:24:37.915>on <00:24:38.195>the <00:24:38.475>number <00:24:38.755>object?

609
00:24:40.025 --> 00:24:43.365
<00:24:40.025>Yes <00:24:40.165>it <00:24:40.305>does. <00:24:40.445>Has <00:24:40.585>it <00:24:40.725>been <00:24:40.865>repaired? <00:24:41.005>No, <00:24:41.145>it <00:24:41.285>has <00:24:41.425>not.

610
00:24:46.165 --> 00:24:47.405
<00:24:46.165>I <00:24:46.444>I <00:24:46.723>would <00:24:47.002>have <00:24:47.281>loved

611
00:24:47.405 --> 00:24:49.445
<00:24:47.405>to <00:24:47.580>be <00:24:47.754>in <00:24:47.930>the <00:24:48.105>room <00:24:48.280>when <00:24:48.455>this <00:24:48.629>meeting <00:24:48.805>occurred,

612
00:24:49.495 --> 00:24:53.005
<00:24:49.495>where <00:24:49.669>somebody <00:24:49.844>has <00:24:50.020>to <00:24:50.195>decide <00:24:50.370>that <00:24:50.544>this <00:24:50.719>is <00:24:50.895>supposed

613
00:24:53.005 --> 00:24:54.245
<00:24:53.005>to <00:24:53.284>be <00:24:53.563>a <00:24:53.841>straight <00:24:54.120>alias.

614
00:24:54.355 --> 00:24:55.725
<00:24:54.355>This <00:24:54.766>is <00:24:55.177>object <00:24:55.588>identical.

615
00:24:55.735 --> 00:24:57.685
<00:24:55.735>These <00:24:56.014>are <00:24:56.294>just <00:24:56.574>two <00:24:56.854>names <00:24:57.135>pointing

616
00:24:57.685 --> 00:24:59.485
<00:24:57.685>to <00:24:57.965>the <00:24:58.245>exact <00:24:58.524>same <00:24:58.804>function <00:24:59.085>object.

617
00:24:59.785 --> 00:25:02.125
<00:24:59.785>The <00:25:00.018>one <00:25:00.251>opportunity <00:25:00.485>to <00:25:00.718>make <00:25:00.951>JavaScript <00:25:01.185>better

618
00:25:02.185 --> 00:25:03.325
<00:25:02.185>to <00:25:02.698>repair <00:25:03.211>something

619
00:25:03.325 --> 00:25:06.405
<00:25:03.325>that's <00:25:03.558>broken <00:25:03.791>has <00:25:04.025>been <00:25:04.258>wasted, <00:25:04.491>just <00:25:04.725>wasted.

620
00:25:06.585 --> 00:25:08.805
<00:25:06.585>And <00:25:06.818>for <00:25:07.051>this <00:25:07.285>fact <00:25:07.518>alone, <00:25:07.751>pass <00:25:07.985>in,

621
00:25:08.805 --> 00:25:11.125
<00:25:08.805>in <00:25:09.038>my <00:25:09.271>mind <00:25:09.505>belongs <00:25:09.738>into <00:25:09.971>the <00:25:10.205>Ste.

622
00:25:11.475 --> 00:25:14.205
<00:25:11.475>Like <00:25:11.649>this <00:25:11.824>is <00:25:12.000>your <00:25:12.175>naming <00:25:12.350>fail. <00:25:12.524>First <00:25:12.699>and <00:25:12.875>foremost.

623
00:25:14.425 --> 00:25:16.245
<00:25:14.425>It <00:25:14.658>tells <00:25:14.891>you <00:25:15.125>it <00:25:15.358>returns <00:25:15.591>an <00:25:15.825>inte,

624
00:25:16.785 --> 00:25:20.005
<00:25:16.785>but <00:25:16.912>it <00:25:17.039>doesn't, <00:25:17.166>it <00:25:17.294>returns <00:25:17.421>afloat <00:25:17.548>then <00:25:17.675>it <00:25:17.803>works <00:25:17.930>like <00:25:18.057>a <00:25:18.185>trap.

625
00:25:20.025 --> 00:25:21.285
<00:25:20.025>You <00:25:20.251>just <00:25:20.478>shove <00:25:20.705>input <00:25:20.932>in <00:25:21.159>there

626
00:25:21.425 --> 00:25:23.925
<00:25:21.425>and <00:25:21.600>it <00:25:21.774>works <00:25:21.950>until <00:25:22.125>it <00:25:22.300>suddenly <00:25:22.475>stops <00:25:22.649>to <00:25:22.825>work

627
00:25:23.925 --> 00:25:26.085
<00:25:23.925>because <00:25:24.205>you <00:25:24.485>know <00:25:24.764>your <00:25:25.044>numbers, <00:25:25.325>um,

628
00:25:26.485 --> 00:25:27.965
<00:25:26.485>suddenly <00:25:26.818>start, <00:25:27.150>start <00:25:27.484>with <00:25:27.817>OX.

629
00:25:28.265 --> 00:25:31.165
<00:25:28.265>And <00:25:28.420>there <00:25:28.576>was <00:25:28.731>this <00:25:28.887>wasted <00:25:29.042>opportunity <00:25:29.198>to <00:25:29.353>make <00:25:29.509>things <00:25:29.665>better.

630
00:25:31.465 --> 00:25:32.645
<00:25:31.465>So <00:25:31.730>this <00:25:31.995>in <00:25:32.261>my <00:25:32.527>mind,

631
00:25:32.645 --> 00:25:35.365
<00:25:32.645>even <00:25:32.820>though <00:25:32.995>it <00:25:33.170>seems <00:25:33.345>harmless <00:25:33.520>on <00:25:33.695>the <00:25:33.870>surface <00:25:34.045>is

632
00:25:35.465 --> 00:25:36.485
<00:25:35.465>the <00:25:35.924>worst <00:25:36.382>case.

633
00:25:36.515 --> 00:25:37.845
<00:25:36.515>It's <00:25:36.914>a <00:25:37.313>multilevel <00:25:37.712>catastrophe.

634
00:25:38.025 --> 00:25:40.645
<00:25:38.025>It <00:25:38.225>is <00:25:38.425>wasted <00:25:38.625>potential, <00:25:38.825>it's <00:25:39.025>a <00:25:39.225>trap <00:25:39.425>and

635
00:25:40.645 --> 00:25:42.645
<00:25:40.645>therefore <00:25:40.925>it <00:25:41.205>belongs <00:25:41.485>to <00:25:41.764>the <00:25:42.045>Ste.

636
00:25:42.645 --> 00:25:45.405
<00:25:42.645>Ladies <00:25:42.800>and <00:25:42.956>gentlemen. <00:25:43.111>Non-binary <00:25:43.267>neuro, <00:25:43.422>at <00:25:43.578>least <00:25:43.733>in <00:25:43.889>my <00:25:44.045>mind.

637
00:25:46.275 --> 00:25:48.725
<00:25:46.275>Okay, <00:25:46.475>I'm <00:25:46.675>now <00:25:46.875>kind <00:25:47.075>of <00:25:47.275>out <00:25:47.475>of <00:25:47.675>time.

638
00:25:48.985 --> 00:25:51.445
<00:25:48.985>So <00:25:49.140>there's <00:25:49.296>just <00:25:49.451>a <00:25:49.607>quick <00:25:49.762>lightning <00:25:49.918>round <00:25:50.073>with <00:25:50.229>other <00:25:50.385>features

639
00:25:51.445 --> 00:25:55.085
<00:25:51.445>that <00:25:51.620>I <00:25:51.794>think, <00:25:51.970>um, <00:25:52.145>should <00:25:52.320>be <00:25:52.495>more <00:25:52.669>well <00:25:52.845>known.

640
00:25:55.205 --> 00:25:56.765
<00:25:55.205>I <00:25:55.485>mean, <00:25:55.764>document <00:25:56.044>all <00:25:56.324>is <00:25:56.605>fun.

641
00:25:57.235 --> 00:25:59.165
<00:25:57.235>It's, <00:25:57.468>um, <00:25:57.701>it <00:25:57.935>does <00:25:58.168>very <00:25:58.401>different <00:25:58.635>things

642
00:25:59.165 --> 00:26:00.325
<00:25:59.165>depending <00:25:59.339>on <00:25:59.513>how <00:25:59.687>you <00:25:59.861>look <00:26:00.035>at <00:26:00.209>it.

643
00:26:00.585 --> 00:26:03.765
<00:26:00.585>It <00:26:00.712>claims <00:26:00.839>to <00:26:00.966>be <00:26:01.094>nothing. <00:26:01.221>It <00:26:01.348>claims <00:26:01.475>to <00:26:01.603>be <00:26:01.730>a <00:26:01.857>different <00:26:01.985>type.

644
00:26:03.995 --> 00:26:06.125
<00:26:03.995>It's <00:26:04.228>very <00:26:04.461>bizarre, <00:26:04.695>but <00:26:04.928>kind <00:26:05.161>of <00:26:05.395>irrelevant.

645
00:26:06.125 --> 00:26:08.725
<00:26:06.125>So <00:26:06.280>I <00:26:06.436>don't <00:26:06.591>really <00:26:06.747>care. <00:26:06.902>New <00:26:07.058>array <00:26:07.213>is <00:26:07.369>very <00:26:07.525>funny,

646
00:26:08.905 --> 00:26:10.245
<00:26:08.905>but <00:26:09.206>also <00:26:09.508>not <00:26:09.809>very <00:26:10.110>important

647
00:26:10.245 --> 00:26:11.565
<00:26:10.245>because <00:26:10.482>you <00:26:10.720>never <00:26:10.957>write <00:26:11.195>new <00:26:11.433>array.

648
00:26:11.585 --> 00:26:12.925
<00:26:11.585>So <00:26:11.987>this <00:26:12.389>is, <00:26:12.791>um,

649
00:26:13.265 --> 00:26:15.725
<00:26:13.265>all <00:26:13.498>fine <00:26:13.731>function <00:26:13.965>string <00:26:14.198>ification, <00:26:14.431>same <00:26:14.665>thing.

650
00:26:16.645 --> 00:26:19.045
<00:26:16.645>I <00:26:16.800>could <00:26:16.956>take, <00:26:17.111>I <00:26:17.267>could <00:26:17.422>talk <00:26:17.578>for <00:26:17.733>ages <00:26:17.889>about <00:26:18.045>strings.

651
00:26:19.075 --> 00:26:20.925
<00:26:19.075>Strings <00:26:19.275>are <00:26:19.475>bad. <00:26:19.675>Strings <00:26:19.875>are <00:26:20.075>a <00:26:20.275>bad <00:26:20.475>idea.

652
00:26:20.925 --> 00:26:22.445
<00:26:20.925>They, <00:26:21.153>they <00:26:21.380>should <00:26:21.609>have <00:26:21.837>never <00:26:22.065>been <00:26:22.293>invented

653
00:26:22.625 --> 00:26:23.965
<00:26:22.625>and <00:26:23.027>everything <00:26:23.428>is <00:26:23.831>wrong.

654
00:26:24.095 --> 00:26:26.245
<00:26:24.095>Every <00:26:24.375>API <00:26:24.655>is <00:26:24.935>broken, <00:26:25.215>nothing <00:26:25.495>works.

655
00:26:26.355 --> 00:26:28.485
<00:26:26.355>Strings <00:26:26.588>are <00:26:26.821>the <00:26:27.055>entire <00:26:27.288>concept <00:26:27.521>is <00:26:27.755>dt.

656
00:26:28.625 --> 00:26:30.645
<00:26:28.625>And <00:26:28.825>then <00:26:29.025>there's, <00:26:29.225>you <00:26:29.425>know, <00:26:29.625>strange <00:26:29.825>things <00:26:30.025>like

657
00:26:31.205 --> 00:26:33.845
<00:26:31.205>negative <00:26:31.438>zero <00:26:31.671>and <00:26:31.905>strange <00:26:32.138>method <00:26:32.371>on <00:26:32.605>strings

658
00:26:33.845 --> 00:26:36.005
<00:26:33.845>where <00:26:34.020>you <00:26:34.195>can <00:26:34.370>just <00:26:34.545>call <00:26:34.720>bold <00:26:34.895>on <00:26:35.070>a <00:26:35.245>string

659
00:26:36.005 --> 00:26:39.285
<00:26:36.005>and <00:26:36.132>get <00:26:36.259>back <00:26:36.386>some <00:26:36.514>HTML <00:26:36.641>even <00:26:36.768>in <00:26:36.895>OJS <00:26:37.023>doesn't <00:26:37.150>make <00:26:37.277>any <00:26:37.405>sense,

660
00:26:39.305 --> 00:26:41.165
<00:26:39.305>but <00:26:39.538>it's <00:26:39.771>part <00:26:40.005>of <00:26:40.238>the <00:26:40.471>JavaScript <00:26:40.705>specification

661
00:26:41.385 --> 00:26:42.565
<00:26:41.385>for <00:26:41.916>historical <00:26:42.447>reasons.

662
00:26:43.225 --> 00:26:44.725
<00:26:43.225>So <00:26:43.495>this <00:26:43.764>is <00:26:44.034>my <00:26:44.304>lightning <00:26:44.574>ground.

663
00:26:44.795 --> 00:26:48.565
<00:26:44.795>This <00:26:44.922>is <00:26:45.049>my, <00:26:45.176>uh, <00:26:45.304>entire <00:26:45.431>tier <00:26:45.558>list <00:26:45.685>when <00:26:45.813>it <00:26:45.940>comes <00:26:46.067>to, <00:26:46.195>um,

664
00:26:48.595 --> 00:26:51.205
<00:26:48.595>basically <00:26:48.828>ranking <00:26:49.061>all <00:26:49.295>the <00:26:49.528>broken <00:26:49.761>JavaScript <00:26:49.995>features

665
00:26:51.515 --> 00:26:53.285
<00:26:51.515>that <00:26:51.715>at <00:26:51.915>least <00:26:52.115>I <00:26:52.315>can <00:26:52.515>come <00:26:52.715>up <00:26:52.915>with.

666
00:26:54.465 --> 00:26:57.325
<00:26:54.465>And <00:26:54.592>this <00:26:54.719>is <00:26:54.846>more <00:26:54.974>or <00:26:55.101>less <00:26:55.228>all <00:26:55.355>I <00:26:55.483>have <00:26:55.610>for <00:26:55.737>you <00:26:55.865>today.

667
00:26:57.615 --> 00:27:00.285
<00:26:57.615>Thank <00:26:57.770>you <00:26:57.926>for <00:26:58.081>coming <00:26:58.237>here <00:26:58.392>and <00:26:58.548>have <00:26:58.703>a <00:26:58.859>nice <00:26:59.015>conference.