I am trying to wrap my head around using functions in javascript as 'class definitions' the way i may have in other languages before coming to js. using require js i have a few example files like so for a State class and a Capital class (just example objects).
// main.js
require(['state.js', 'capital.js'], function(){
var x = new State();
});
// state.js
require(['capital.js'], function(){
function State(){
this.population = 1,
this.name = "New Jersey",
this.capital = new Capital(),