So I am currently doing this in my Js script:
var someObject = require('./stored');
this.makeDuplicates = function(){
var storeDuplicates = [];
this.addDuplicates = function(astring){
storeDuplicates[astring] = new someObject();
}
this.printDuplicate = function(){
console.log(storeDuplicates["hello"]);
}
}
var input = "hello"
var newDupe = new makeDuplicates()
newDupe.addDuplicates(input)
newDupe.printDuplicate()
this will then print undefined. Why isn't this being correctly done? I would assume it would create a hash-like table where "string"->ref to object, but it doesn't seem like it. How can I go about this? Thanks!