Undefined Error [Solved]


#1

I am having an issue with some code. Whenever I run it, i get an error saying Population is undefined in setup.
The code is at the github link below.


#2

I think it has to do with the order of things that you load within index.html. You load sketch.js before Population.js, so at the time you load sketch.js there was nothing before it that defined Population.js.

I suggest putting the <script language="javascript" type="text/javascript" src="sketch.js"></script> line at the end of the <script... wall instead.


#3

That didn’t seem to fix it. :frowning:


#4

I have found the problem! I was changing the code from java, and instead of var I accidentally said the class name.


#5

Oh. Glad that thing got resolved.

Care to change thread title to say [Solved] or something, so that people wouldn’t start writing more possible solutions?