solve js problem