Use function as the object constructor
<head>
<title></title>
</script>
</head>
<body>
<script type = "text/javascript" >
function Song(artist,length,title) {
this.artist = artist;
this.length = length;
this.title = title;
}
song1 = new Song("A","3:30","title");
</script>
<p>Songs</p>
</body>
Related examples in the same category