CodesJava

Easy learning with example program codes

TypeScript for in loop tutorial

The for in loop is used to iterate the properties of an object.

Syntax:

for(property in object){
 //Block of statements 
}

TypeScript for in loop example:

var person = {Fname:"Rajeev", Lname:"Johari", Age:40};
var perproperty;
for (perproperty in person) {
console.log(perproperty + ": " + 
person[perproperty ]);
}

 

Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status