Easy learning with example program codes

TypeScript for in loop tutorial

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


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 ]);

Try it:

JS Bin on

Please follow and like us:

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki