Transcript from the "Helpful Shorthand Methods" Lesson
>> So now I'm going to open my, we're going to follow now step by step what we have here. And we're going to start with initializing the project. And this is something that we won't use, but I wanna show you what this is. One of the fears that we have is, or one of the challenges that we sometimes have when we are working with vanilla JS, is that it's too verbose.
[00:02:20] So then you can create the variable with a name underscore. So instead of a variable, you can use a function or an object, you can create an object with some functions that you use a lot. For example, domready, and you receive an event. And you say that this is, I'm doing a mix here of syntaxes, something like this, like so.
[00:02:50] And then here you say, okay, domready is going to be window.addEventListener. So then you use domready, and you pass a function. I'm doing a mix here, that's the syntax. So then domready equals to, I'm just playing with this, okay? But I'm showing you that, yeah, you're creating your own library if you do that.
[00:03:13] And that's, we are going back to that slide where I show you a tweet. Saying that maybe it's a good idea to, at one point, when you are doing vanilla JS, creating your own library. Of course, when we are doing things like this, we are reducing, let's say, Having clean code for others to read, things like that.
[00:04:01] We won't be using this today, we will stay with verbose vanilla JS.