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(), this.capital.name = "Trenton", this.capital.population = 999,999; this.description = function( ){ console.log( this.name + " has a population of " + this.population + '. The capital of ' + this.name + ' is ' + this.capital.name ); this.capital.description(); } } }); // capital.js function Capital(){ this.population = 1, this.name = "Carson City"; this.description = function(){ console.log(this.name + ' has a population of ' + this.population); } } i've tried defining blocks in require.js and returning the constructor. passing values into the anonymous function that is the second parameter such as : `function(State, Capital){...}` and what i am seeing is typically an error along the lines of "State is not defined" - Am I approaching this the wrong way thinking that i can define a 'constructor' in another file then utilize it later in the main script? (the whole practice is an exercise for me - working on & learning methods for organizing files for a project i am planning to be very large)