All language subtitles for 003 Running Javascript Outside the Browser.en

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Welcome back.

So I hope that you have Node installed

on your computer at this point.

And so, let's now actually go ahead

and use Node for the very first time.

And to get started with the section,

please go into the course starter files

and copy this folder to your working directory, okay?

Now, if you didn't download the course files yet,

please go to the GitHub repository,

that is linked all over the course,

and you will find all the files that you need in there.

Then after that, go ahead and open up

the folder in your code editor.

And I'm using VS Code here.

And I actually already loaded it up.

So here is this Node Farm folder.

Now in this video, we will actually

not yet start with the project.

But instead, we're gonna interact with Node

using the command line.

And for that, I'm gonna use the built-in terminal

that VS Code has, hitting control back take for that.

So this command that you see here, actually.

Or you can go to View and Terminal.

Now if you prefer to use another application

for the terminal, that's fine as well

but throughout this course,

I'm always going to use the terminal

that is built in right into VS Code

so that we don't have to jump around

between different windows so much.

Now, to start writing some Node code here in the console,

all we have to do is to write node,

given that you have Node.js installed on your computer

and then, just hit enter.

And this will then open up the Node REPL,

which stands for read-eval-print loop.

So basically here, we can write JavaScript code

just like in a normal terminal.

For example, we can define variables.

And so, here it is.

So, we just defined the name variable.

And in fact, we can write any JavaScript code

that we like in here, okay?

So, that's because at the end of the day,

Node.js is really just a JavaScript run time,

as we just saw before.

So what else can we do?

Well, any type of expression really, will work.

Let's just do some math here, for example.

Okay so any JavaScript will work

and you see that we actually

defined this variable here using const so that is ES6

and that is absolutely no problem in Node.js.

So it supports ES6 in all the newer versions

out of the box without any problem.

That's because we're not running

this JavaScript in any browser,

but it will always run on the server, okay?

So, in fact, we just took JavaScript out of the browser

and we're running it inside of this Node application.

Now if we wanted to exit JS REPL,

so again, this read-eval-print loop, that Node gives us,

there are different ways of doing that.

The first one is to write exit

or actually .exit

and so this exited this Node process, this REPL

and so that started again so that I can

show you some more stuff.

So again, just type Node, hit enter, and that's it.

Oh, and, by the way, if you want to

clear your terminal like I just did,

all you have to do is to hit command K

and that will then clear the command line

and probably on Windows, that is control K, okay?

Anyway, we use the .exit to exit the REPL

but we can also hit control D,

and that's not command, it is really control,

so control D will do the same.

But, let's quickly enter it again

'cause there's some more stuff that I want to show you.

So if you hit tab right now,

maybe you have to tap it twice,

sometimes that happens for some reason,

but anyway, by hitting tab,

you can see all the global variables

that are available in Node.

So you have all the kind of stuff

that we're already used to

like the Array constructor

or the String constructor

or Math

or Number over here,

but then there's also all kinds of stuff

that belongs to Node.

For example, your https and fs or crypto

and these are Node modules

that we're gonna talk more about

a bit later in the section.

But for now, you see that we have all kinds

of global variables that we can access

whenever we want in Node.js, okay?

Also, another nice trick is the underscore variable.

So let me first show you something.

So another calculation for example.

Three times eight gives 24

and now was can use underscore plus six

and so this will give us 30

and so that means that underscore

is basically your previous result.

So we had 24, and so underscore here is 24 now

and 24 plus six makes 30.

So if we now did underscore minus 30,

that will give us zero, right?

And yeah, it did.

Okay, and finally, the tab that you just pressed before,

you can also press that, for example,

on one of these constructor

that we already know like string.

So String. and now by adding tab,

you can see all the methods or properties

that are available to us.

Again, sometimes you have to hit it twice

but then here we are.

So we have, for example, length or hasOwnProperty,

and all these kinds of methods here

that we know already, right?

And now, to exit the REPL,

remember all you have to do is hit control D.

Okay, then command K to clear the console,

and that's it.

So that's all I wanted to show you

in this very, very first video.

So basically that we can write JavaScript now

outside of the browser using Node.js like this.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.