Follow us on Facebook
Faucibus toroot menuts
Loops are essential part of any programing language. Using loop you can iterate same statement without writing that again and again.
Loop have 3 parts.
While Loop Example :
Do while Loop
For loop Example
for...in loop Example :
Apart from for loop, TypeScript also support for in loop. The for… in loop can be used to repeat over a set of values as in the case of an array or a tuple.
The for...in loop is used to iterate through a list or collection of values. But for for in loop the data type should be string or any.
Difference between for in and for of
‘For in’ displays the keys for the array while ‘for of ‘ displays the value list of the array.