Simple model of a spiking neuron using javascript