How to organize correct javascript inheritance? [migrated]

I want to build a grid and I have 2 concepts: Grid which is consist of Cell.

Grid class is:

var Grid = function (rows, columns, cellInit) {
    var canvas = create_canvas();
    this.context = canvas.getContext('2d');

    this.matrix = new Array(rows);
    for (var x = 0; x < rows; x+=1) {
        this.matrix[x] = new Array(columns);
        for (var y = 0; y < columns; y+=1) {
            this.matrix[x][y] = new Cell(x, y, cellInit(), this.context);
        }
    }
};

Cell class is:

var Cell = function (x, y, value, context) {
    this.x = x;
    this.y = y;
    this.rectX = s.cell_width * this.x + s.pad;
    this.rectY = s.cell_height * this.y + s.pad;
    this.value = value;
    this.context = context;
};

read more

How to organize correct javascript inheritance? [migrated]

I want to build a grid and I have 2 concepts: Grid which is consist of Cell.

Grid class is:

var Grid = function (rows, columns, cellInit) {
    var canvas = create_canvas();
    this.context = canvas.getContext('2d');

    this.matrix = new Array(rows);
    for (var x = 0; x < rows; x+=1) {
        this.matrix[x] = new Array(columns);
        for (var y = 0; y < columns; y+=1) {
            this.matrix[x][y] = new Cell(x, y, cellInit(), this.context);
        }
    }
};

Cell class is:

var Cell = function (x, y, value, context) {
    this.x = x;
    this.y = y;
    this.rectX = s.cell_width * this.x + s.pad;
    this.rectY = s.cell_height * this.y + s.pad;
    this.value = value;
    this.context = context;
};

read more

IDG Contributor Network: Why the FCC’s 911 locating mandate was a colossal failure

Locating became a standard feature of mobile phone service in the years following the Federal Communications Commission’s (FCC) order released in 1999 that described in detail how mobile network operators must provide the locations of wireless 911 callers to emergency call centers. The decision to require wireless 911 locating was first announced in 1996, when mobile phones were mainly used outdoors. People still relied on wired phones indoors — and the phone company already knew the street address associated with each pair of wires.

read more

Nobel in Medicine goes to treatments for parasites

Ivermectin (left) and artemisinin both have complicated structures that synthetic chemists might have struggled to come up with.

We have successfully developed vaccines for many viruses and bacteria, and antibiotic and antiviral drugs can often be used to effectively treat infected individuals. But parasite infections pose significant challenges to traditional treatment approaches. This year’s Nobel Prize in Medicine has gone to researchers who created treatments for some of humanity’s biggest scourges: river blindness, as well as other nematode diseases, and malaria.

read more