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() {
    console.log('do stuff');
}

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

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

window.setInterval(function(){p.physicsStep()}, 1000);