Skip to content

Instantly share code, notes, and snippets.

@verdi327
Last active December 16, 2015 09:49
Show Gist options
  • Save verdi327/5416025 to your computer and use it in GitHub Desktop.
Save verdi327/5416025 to your computer and use it in GitHub Desktop.
function newspaper(name, left, top, width, height) {
this.name = name;
this.left = left;
this.top = top;
this.width = width;
this.height = height;
}
var nyTimes = new newspaper('nytimes', 200, 440, 1400, 800);
var laTimes = new newspaper('latimes', 500, 200, 1000, 900);
var bbc = new newspaper('bbc', 500, 500, 400, 600);
var newspapers = [nyTimes, laTimes, bbc];
for (var i=0; i < newspapers.length; i++ ) {
console.log(newspapers[i].name)
console.log(newspapers[i].left)
console.log(newspapers[i].top)
console.log(newspapers[i].width)
console.log(newspapers[i].height)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment