Check this link it will help https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_state_forin
var person = {fname:"John", lname:"Doe", age:25}; var text = ""; var x; for (x in person) { text += person[x] +""; // where x will be fname,lname,age }Console.log(text);