Object Literals

[Total: 0    Average: 0/5]

This just shows how to create a data object literal and how to access it.

Body Code:

<script type=text/javascript>
var man = {
  name    : "mike",
  age     : "old",
  married : true,
  email   : "mike@js-examples.com"}
var x=0
for (var i in man)
document.writeln("#"+ (++x) +": "+i+"="+man[i]+"<BR>");

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *