practiced javascript class exercise