for in loop in JS

for in loop in JS


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>for in loop in JS</title>



</head>
<body>
<script>

var a = {
name : "praveen",
age : 25,
class : 12,
lastname : "kumar"
};

for( var i in a)
{
console.log(i + " : " + a[i]);
document.write(i + " : " + a[i] + "<br>");
}
</script>
</body>
</html>




Comments

Popular posts from this blog