1 00:00:00,390 --> 00:00:01,320 Welcome back, everyone. 2 00:00:02,040 --> 00:00:04,890 Now I have some good news and some bad news. 3 00:00:05,820 --> 00:00:08,100 Let's start off with the bad news. 4 00:00:08,310 --> 00:00:16,830 The bad news is that in Yes, 2021, which is the latest version of JavaScript, the changes to the 5 00:00:16,830 --> 00:00:19,080 language there aren't that many. 6 00:00:19,170 --> 00:00:25,020 There aren't that many new, exciting features you can Google East 2021 features, and a lot of them 7 00:00:25,020 --> 00:00:29,340 are obscure features that most likely you won't encounter in your day today. 8 00:00:29,880 --> 00:00:36,330 Now, the good news is that while you don't have to learn a whole lot of new features, as a matter 9 00:00:36,330 --> 00:00:40,230 of fact, there's one important one that I'm going to show you in this video, but that's it. 10 00:00:40,500 --> 00:00:41,610 Nice and easy. 11 00:00:41,820 --> 00:00:42,450 Isn't that nice? 12 00:00:42,570 --> 00:00:42,810 Nice. 13 00:00:42,810 --> 00:00:43,380 Quick VIDEO. 14 00:00:44,550 --> 00:00:46,200 So let's see how quickly we can do this. 15 00:00:46,860 --> 00:00:48,360 Let's say I have a string here. 16 00:00:48,420 --> 00:00:50,100 I'll call it SDR for string. 17 00:00:50,460 --> 00:00:51,900 And Oh, I like this one. 18 00:00:52,050 --> 00:00:55,920 The XHTML is the best of the best. 19 00:00:56,980 --> 00:01:03,040 So let's make that into a strength, so our strengths as ZM as the best of the best. 20 00:01:03,190 --> 00:01:04,360 I'm a little bit biased here. 21 00:01:04,480 --> 00:01:05,530 Well, let's go along with it. 22 00:01:05,710 --> 00:01:12,390 So with a new feature in Yes, 2021, we have something that we can use on all strengths. 23 00:01:12,400 --> 00:01:14,680 It's a method that we can use on all strengths. 24 00:01:14,920 --> 00:01:24,040 So if I do the string dot replace, oh, look at that, it already pops up, replace all what it does. 25 00:01:24,040 --> 00:01:28,270 It allows me to replace something inside the string. 26 00:01:28,750 --> 00:01:32,020 So let's say I want to change best in the string. 27 00:01:32,020 --> 00:01:36,160 So let's say best and I want to change that to worst. 28 00:01:37,710 --> 00:01:44,640 So if I replace that string that I get, Zeitoun is the worst of the worst. 29 00:01:44,890 --> 00:01:48,630 Well, that's a little bit rude, but that's what we got with replaceable. 30 00:01:49,110 --> 00:01:50,340 If I do string here. 31 00:01:51,850 --> 00:01:56,950 Zeitoun is the best of the best, and that's because we didn't really assign this to anything the original 32 00:01:56,950 --> 00:01:57,970 string remains. 33 00:01:58,270 --> 00:02:01,570 But the new string, so I could have done something like this. 34 00:02:01,840 --> 00:02:05,800 I could have assigned it and I could have said Konst, be equals. 35 00:02:06,850 --> 00:02:11,200 This and now be is XHTML as the worst of the worst? 36 00:02:11,260 --> 00:02:12,600 I definitely don't like this one. 37 00:02:12,610 --> 00:02:13,540 I like the other one better. 38 00:02:14,830 --> 00:02:15,920 Now that's it. 39 00:02:16,150 --> 00:02:19,490 Yes, 2021, this is all we really got. 40 00:02:19,570 --> 00:02:23,230 I mean, it's pretty nice to have a fun little side effect. 41 00:02:23,710 --> 00:02:27,670 JavaScript actually used to have something called replace already. 42 00:02:28,180 --> 00:02:32,680 So we could have done cost, see, shrink and replace. 43 00:02:32,680 --> 00:02:36,040 There used to be part of all JavaScript, so it's not anything new. 44 00:02:36,730 --> 00:02:43,210 But with this one, the problem with this one is it only changed the first instance of the word. 45 00:02:43,240 --> 00:02:46,450 So you can see here is ITM is the worst of the best. 46 00:02:47,170 --> 00:02:52,540 A little bit better, but definitely, definitely not the best of the best. 47 00:02:53,110 --> 00:02:56,280 So anyway, fun, little fact, fun, little tidbit. 48 00:02:56,290 --> 00:02:58,870 Yes, 2021, we have this replace. 49 00:02:58,870 --> 00:03:00,310 Oh OK. 50 00:03:00,520 --> 00:03:04,180 I managed to make this video way too long for what this really is. 51 00:03:04,270 --> 00:03:05,080 Pretty easy, right? 52 00:03:05,290 --> 00:03:05,560 All right. 53 00:03:05,770 --> 00:03:07,720 Go grab a coffee and I'll see you in the next one. 54 00:03:07,870 --> 00:03:08,260 Bye bye.