All language subtitles for 9- Break and Continue

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
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
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

With all the

loops you have learned about in this section, there are two keywords,

break and continue that can change how the loop behaves. In this demo I'm going to

use a while loop. But what you're going to learn applies to all loops

we have learned in this section. So let's start by declaring a variable

called i and initialize it to 0. Now we put this

in a while loop, as long as while is less than or equal to

10, we're going to display i on the console

and then increment it. Save the changes, so

this gives us numbers 0-10. Now sometimes you want to jump

out of a loop for some reason that may happen at run time.

For example, here we can have an if condition

an if statement, with a condition like this.

If i equals 5, we want to jump out of this loop.

That's where we use the break keyword. Now when we save

the changes, see what happens we get the numbers 0

to 4. So at the end of the 5th iteration here we

increment i, now i is 5, so we break out of the loop.

Now let me comment this out and look at the continue keyword.

So I'm going to write another if statement, I want to see

if i is an even number or not. So i,

module is 2, equals 0. If that's the case,

I want to increment i and then continue.

Let's see what happens when we run this code. Save the changes,

we only get the odd numbers, why is that? Alright

let's take a look at an example. So when i becomes 2,

it's an even number, at this point increment i,

i will be 3. Now when the JavaScript engine sees the

continue keyword. It will jump to the beginning of the loop.

And continues it's execution in the next iteration.

At this point i is 3, so this if statement is not executed,

that's why we see i on the console. Now,

in my personal experience, continue is not something you will use that often,

it's one of those old legacy things in JavaScript, I'm only explaining

it here in case you see it in projects you're working on. It's not some

thing that I recommend you to use, it's an ugly way of writing code.

So just to recap with the correct keyword, you jump out of a

loop, and with the continue keyword, we jump to the next iteration.

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