All language subtitles for 6- Infinite Loops

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
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
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
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
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
pl Polish
pt-BR Portuguese (Brazil) Download
pt Portuguese (Portugal) Download
pa Punjabi
qu Quechua
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-419 Spanish (Latin American) Download
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
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

When writing loops

something that you need to be aware of is what we call an infinite loop.

So an infinite loop as the name implies, executes

infinitely or forever. So if you accidentally create one of these

loops, you're going to crash your browser or your computer. Let me show you an example.

So here I'm going to declare a variable, set it

to 0, put it in a while loop, so as long as

i is less than 5, we're going to do a console.log,

of i, now here technically we should increment

i, but if you forget to do so, you end up creating an

infinite loop, because in the first iteration, i is 0.

And it's less than 5, so we'll display an i on the console.

Now, in the second iteration i is still 0, and less than 5.

So this loop could run forever. So I'm going to save the changes,

now on the console, this number you see before 0

is the number of times you're displaying 0 on the console,

so you can see this number is increasing rapidly

so far we have displayed 0, more than 35 hundred times.

And if you look at the browser, you can see this spinner going forever.

So the only way to get rid of this is to close this window,

or if this doesn't work, you'll have to force quit

Chrome. So this is

1 example of an infinite loop. Here's another example

while true. Again, this loop is going to run forever.

So it's an infinite loop. And by the way, infinite loops are not

limited to while loops, we can create an infinite

do while loop, so do while

true. Or similar to the last example, maybe we'll

create a loop variable like 0 and then

have a condition like x is less than 5, but we forget to

increment x here. We can also create

an infinite for loop. So, for

let i equal to 0, as long as i is greater than

0, i ++, again with the condition that we have

placed here this loop is going run forever, or maybe we

have the right condition, like i is less than 10, but we forget

to add the third part. So we don't increment i, and this is

exactly like this while loop that we had earlier.

Without incrementing i. So be aware of the infinite loops,

avoid them, because they can crash your browser or your computer.

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