JSFiddle - React, Tailwind, and code Playground

JavaScript

var Particles = function() {};

Particles.prototype.physicsStep = function() {
    this.computeForces(); // error in Chrome
    this.integrationStep(); // error in Chrome
}

Particles.prototype.computeForces = function() {
    // do some stuff
}

Particles.prototype.integrationStep = function() {
   // do some stuff
}

var p = new Particles();
p.physicsStep(); // No error here.

window.setInterval(p.physicsStep, 1000);