Array of objects in JS

Array of objects 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>Array of objects in JS</title>



</head>
<body>
<script>

var profile = [
{name : "PRAVEEN", age : 26},
{name : "PRAVEEN Kumar", age : 27},
{name : "PRAVEEN Singh", age : 28},
];

for( var i = 0 ; i<= profile.length ; i++)
{
document.write( "<br>" + profile[i].name + " " + profile[i].age);
}

</script>
</body>
</html>



Comments

Popular posts from this blog