I have a TypeError problem:
function artist(name) {
this.name = name;
this.albums = new Array();
this.addAlbum = function(albumName) {
f
This line
var album = new album(albumName);
shadows the external album
function. So yes, album
isn't a constructor inside the function. To be more precise it's undefined
at this point.
To avoid this kind of problem, I'd suggest naming your "classes" starting with an uppercase :
function Album(name) {
More generally I'd suggest to follow the Google style guide when in doubt.