Q:

trying to learn how to define methods in a new object

I've done a lot of reading about using objects in js and this is one of the techniques that I found for creating an array of objects and defining a method within each:
function myObj(){
        this.dCount = 0;

        this.myMethod = function(){
            dCount = 1;
            console.log(dCount);
        }
}

var objects = new Array();

function loadObjs(){

        for(var i = 0; i < 4; i++){
            var myObj = new Object();
            objects[i] = myObj;
        }

        objects[0].myMethod();
}

However, this (and all the other techiques I've tried) returns objects[0].myMethod is not a function.
I still don't get it.  Can someone please help?

A:

You are instanciating a generic object, not your own.
Try this:
objects[i] = new myObj;

