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
Post a Comment
I WOULD APPRECIATE IF YOU LEAVE A COMMENT OR YOUR FEEDBACK HERE !!!