While Loop

2 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€85.01
List Price:  €119.02
You save:  €34
£74.08
List Price:  £103.71
You save:  £29.63
CA$138.06
List Price:  CA$193.28
You save:  CA$55.22
A$151.41
List Price:  A$211.98
You save:  A$60.57
S$128.39
List Price:  S$179.76
You save:  S$51.36
HK$777.55
List Price:  HK$1,088.60
You save:  HK$311.05
CHF 79.50
List Price:  CHF 111.31
You save:  CHF 31.80
NOK kr990.78
List Price:  NOK kr1,387.13
You save:  NOK kr396.35
DKK kr634.55
List Price:  DKK kr888.40
You save:  DKK kr253.84
NZ$170.19
List Price:  NZ$238.28
You save:  NZ$68.08
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,174.73
List Price:  ৳17,045.11
You save:  ৳4,870.37
₹8,810.73
List Price:  ₹12,335.38
You save:  ₹3,524.64
RM420.65
List Price:  RM588.93
You save:  RM168.28
₦149,972
List Price:  ₦209,966.80
You save:  ₦59,994.80
₨28,291.87
List Price:  ₨39,609.76
You save:  ₨11,317.88
฿3,183.98
List Price:  ฿4,457.70
You save:  ฿1,273.72
₺4,138.49
List Price:  ₺5,794.06
You save:  ₺1,655.56
B$531.23
List Price:  B$743.75
You save:  B$212.51
R1,735.27
List Price:  R2,429.45
You save:  R694.17
Лв166.19
List Price:  Лв232.68
You save:  Лв66.48
₩139,621.31
List Price:  ₩195,475.43
You save:  ₩55,854.11
₪333.48
List Price:  ₪466.89
You save:  ₪133.40
₱5,712.52
List Price:  ₱7,997.76
You save:  ₱2,285.23
¥14,792.65
List Price:  ¥20,710.30
You save:  ¥5,917.65
MX$1,835.78
List Price:  MX$2,570.17
You save:  MX$734.38
QR366.82
List Price:  QR513.56
You save:  QR146.74
P1,430.96
List Price:  P2,003.40
You save:  P572.44
KSh12,952.70
List Price:  KSh18,134.30
You save:  KSh5,181.60
E£4,816.78
List Price:  E£6,743.69
You save:  E£1,926.90
ብር14,387.11
List Price:  ብር20,142.53
You save:  ብር5,755.42
Kz91,186.39
List Price:  Kz127,664.59
You save:  Kz36,478.20
CLP$95,570.44
List Price:  CLP$133,802.44
You save:  CLP$38,232
CN¥711.31
List Price:  CN¥995.87
You save:  CN¥284.55
RD$6,221.03
List Price:  RD$8,709.70
You save:  RD$2,488.66
DA12,950.21
List Price:  DA18,130.81
You save:  DA5,180.60
FJ$224.85
List Price:  FJ$314.80
You save:  FJ$89.95
Q766.29
List Price:  Q1,072.85
You save:  Q306.55
GY$20,926.15
List Price:  GY$29,297.44
You save:  GY$8,371.29
ISK kr12,156.78
List Price:  ISK kr17,019.98
You save:  ISK kr4,863.20
DH903.23
List Price:  DH1,264.56
You save:  DH361.32
L1,663.31
List Price:  L2,328.70
You save:  L665.39
ден5,229.59
List Price:  ден7,321.64
You save:  ден2,092.04
MOP$801.41
List Price:  MOP$1,122.01
You save:  MOP$320.59
N$1,743.36
List Price:  N$2,440.78
You save:  N$697.41
C$3,677.54
List Price:  C$5,148.70
You save:  C$1,471.16
रु14,094.94
List Price:  रु19,733.48
You save:  रु5,638.54
S/349.66
List Price:  S/489.54
You save:  S/139.87
K426.80
List Price:  K597.54
You save:  K170.74
SAR375
List Price:  SAR525.01
You save:  SAR150.01
ZK2,370.59
List Price:  ZK3,318.92
You save:  ZK948.33
L431.47
List Price:  L604.08
You save:  L172.60
Kč2,063.99
List Price:  Kč2,889.68
You save:  Kč825.68
Ft33,216.64
List Price:  Ft46,504.62
You save:  Ft13,287.98
SEK kr938.94
List Price:  SEK kr1,314.55
You save:  SEK kr375.61
ARS$147,416.76
List Price:  ARS$206,389.36
You save:  ARS$58,972.60
Bs691.25
List Price:  Bs967.78
You save:  Bs276.52
COP$390,251.14
List Price:  COP$546,367.20
You save:  COP$156,116.06
₡50,404.89
List Price:  ₡70,568.86
You save:  ₡20,163.97
L2,636.34
List Price:  L3,690.98
You save:  L1,054.64
₲716,255.91
List Price:  ₲1,002,786.92
You save:  ₲286,531.01
$U3,994.64
List Price:  $U5,592.65
You save:  $U1,598.01
zł362.46
List Price:  zł507.46
You save:  zł145
Already have an account? Log In

Transcript

Hello, in this JavaScript video, I am going to show you the while loop. So I've got a for loop right here. If this seems a bit alien to you, I would recommend going and checking out the following video. Once you've done that, feel free to pop them back. Okay, so got these for loop eyes have printed that this is incremented by two every single time or call stop with something called a while loop. Let me show you how one works.

Pretty similar. A couple of differences. And enough all those three main parts, there's the setup, the initialization, the condition, the sort of end iteration statement, whereas in a one on one part, and that's the condition itself only for completeness. And you might be thinking, Okay, so how did you get the setup? Any setup needs to occur before. So our code is for j equals zero and we'll send you soon Like this, and any incrementation needs to actually occur with in the within the actual loop itself, it could be at the end of the loop or it could be before so for the statements, that's totally up to you just copy this line.

So this is this is to the show, Jay said This is delicious. Save that need to change this to refresh so we get our zero to 100 and then j zero to 100. Okay, where would you use a while loop over a 40. Okay, so this variable right here that we're using, if this is already been created, and you're just going to use in the wallet, that's a good scenario to use the wallet where you're not actually specifically creating This variable purely for the loop itself, then a wallet is good for it. Whereas if you just want to run a piece of code several times, time and time 10 times doesn't really matter how many times, but you don't actually have this sort of iterator variable already set up and you need to create a new one, then a for loop is the way to go.

That's it for the while loop. Thanks for watching, and I look forward to seeing you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.