4 ms·
It looks like there is something missing in the first example in Javascript. Population = (function() { Population.prototype.genomes = []; })(); This throws
by ville 14y ago
It looks like there is something missing in the first example in Javascript.
Population = (function() {
Population.prototype.genomes = [];
})();
This throws a ReferenceError because Population is not defined.
Genome = (function() {
Genome.prototype.values = [];
function Genome(values) {
this.values = values != null ? values : this.initial();
}
Genome.prototype.inital = function(){
return [RANDOMARRAY FROM [0-14]]
}
})();
After this part Genome will be undefined.
- janmonschke 14y agoThx, forgot to copy the var statements. It's fixed now.