implementation of a neural network in javascript