# Break vs continue vs return

Created by Codedamn about a year ago

0

No description provided

0

could you make this tutorial a bit more explained

kaarn

@kaarn

0

i dont really get this

Chinedu Wali

@chineduwali77

0

why i+=2 can you please explain...

Somnath Golui

@somnathgolui

0

in simple words, if you use continue with condition , the generated result get skipped in output.

Digvijay Jere

@shivjay

4

The single equal to (=) sets the value The double equal to (==) checks the value And the triple equal to (===) checks the value as well as the data type.

Md. Waqui

@waqui27

0

I couldn't get anything from this video. need to update this video with a better explanation.

Mithlesh Kumar

@coderpatel

0

is too fast.

0

Dear please start explaining to beginners , your style of explanation not even for Juniors but for Middle programists

Bahodir AHROROV

@vitamine007

0

This is the best JavaScript for beginner course that I have taken. I am learning a lot from this stuff bruv. Thanks a lot Mahul!

Chidiebere

@weirdcodes

2

Poor Explanation!

0

I didn't understand this :(

Mohammed Akmal

@akmalazeem1

-2

Very well explained

Ibrahima MOUNKORO

@ibrahmounk

2

Confusing Video

3

I believe the idea came randomly to him while recording the video, here's the summary of what he exactly wanted to convey: (just copy paste it on to your editor to see the difference & usecase between break and continue):

//--------------------------------------------------// // break(stops) and continue(skip)

function skipNumber(number){ let remainingNumbers =[]

``````for (let i=0; i<=10 ; i++){
if (i=== number){
continue
}
remainingNumbers.push(i)
}
return remainingNumbers
``````

}

console.log(skipNumber(6))

//--------------------------------------------------// /* break: breaks the iteration and continue: skipping in iteration*/

function breakNumber(number){ let remainingNumbers =[]

``````for (let i=0; i<=10 ; i++){
if (i=== number){
break
}
remainingNumbers.push(i)
}
return remainingNumbers
``````

}

console.log(breakNumber(6))

Melon Eusk

@meloneusk

5

What break does is it exits the loop, nothing below of it will execute , whereas continue just says skip this move on to next, and if you use return in place of break, you not only exit the loop but also the function and function is made to return something, I hope it clears, Keep going Champs!!

Sarvesh Damle

@sarvesh1