Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
WEBVTT
1
00:00:00.000 --> 00:00:04.000
So in the last lecture
2
00:00:04.000 --> 00:00:08.000
we executed this piece of JavaScript code inside of a browser.
3
00:00:08.000 --> 00:00:12.000
In this lecture, I'm going to show you how to run the same code
4
00:00:12.000 --> 00:00:16.000
in Node. So I'm assuming you have installed Node on your machine, if not
5
00:00:16.000 --> 00:00:20.000
head over to nodejs.org and download the latest version of Node.
6
00:00:20.000 --> 00:00:24.000
Now if you're on Windows, open up command prompt, if you're on Mac,
7
00:00:24.000 --> 00:00:28.000
open up terminal, and head over to the folder you create earlier.
8
00:00:28.000 --> 00:00:32.000
Now, in this folder we run Node, and pass the name of
9
00:00:32.000 --> 00:00:36.000
our JavaScript file, that is index.js.
10
00:00:36.000 --> 00:00:40.000
We get the same message on the console. So we can see node is
11
00:00:40.000 --> 00:00:44.000
a program that includes v8 JavaScript
12
00:00:44.000 --> 00:00:48.000
engine. We can give it a piece of JavaScript code, and it will execute that
13
00:00:48.000 --> 00:00:52.000
code for us just like how we can execute some JavaScript code in a browser,
14
00:00:52.000 --> 00:00:56.000
so Node is a run time environment for executing JavaScript code.
15
00:00:56.000 --> 00:01:00.000
Now let me show you a tip. Here in vs code
16
00:01:00.000 --> 00:01:04.000
we have an integrated terminal, so you don't have to explicitly
17
00:01:04.000 --> 00:01:08.000
open up a separate terminal window. So here on the top,
18
00:01:08.000 --> 00:01:12.000
under the view menu, look we have integrated terminal.
19
00:01:12.000 --> 00:01:16.000
Note the short cut here, that's the short cut for Mac,
20
00:01:16.000 --> 00:01:20.000
on Windows you're going to have a different short cut. So, select this,
21
00:01:20.000 --> 00:01:24.000
and here's our integrated terminal, pointing to the same
22
00:01:24.000 --> 00:01:28.000
folder where we created our files. So we don't have to explicitly
23
00:01:28.000 --> 00:01:32.000
navigate to this folder. And here we can run Node
24
00:01:32.000 --> 00:01:36.000
index.js as well. Now in this course we're not going to work with
25
00:01:36.000 --> 00:01:40.000
node anymore, because Node is a completely separate topic, in fact
26
00:01:40.000 --> 00:01:44.000
I have a comprehensive course about Node with 14 hours of content.
27
00:01:44.000 --> 00:01:48.000
So once you finish this course, if you want to learn about Node you can always pick up my Node course.
2569
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.