Walk through how to install live server, add a few files for a base setup, and test it.
- [Instructor] As we work through our examples, we'll need to test our code on the browser and see it in action. If you're using VS Code, and would like to have the same tools I'm using, follow along. Otherwise, feel free to skip this video or install similar tools in your editor of choice. Open up Visual Studio Code and go to the extensions tab. Find the extension Live Server. This is the one we need to install. When you have the extension Live Server all you have to do is click on the little button at the bottom of your screen here to start a Live Server right away, without doing anything like NPM servers and stuff like that.
It will start your server directly from VS Code. Let's go ahead and install this and then reload. That's going to create a new folder on our desktop so let's get out of VS Code, create a new folder and we'll call this scope. We'll open that inside VS Code, so let's go back to VS Code go to Explorer, click on Open Folder, go to Desktop and open scope. Inside of that directory we'll create two new files.
To bring up the developer tools in Chrome for Mac it's Command + Shift + i, and for Windows it's it's Control + Shift + i. Once you have that, let's take a look at the console, that's okay. Them we have our Hello, so this means that our server is working. If you wanna close the server all we have to do is click on the port below, here. If you wanna start it, usually you should have something to start it here. So let's stop it, now you have the go live.
- What is variable scope?
- What are closures?
- Global vs. local variables
- Block-scoped variables