Added constructor to JavaScript