Trying to convert my Python class to a JavaScript class.