Code Lab

Modo entrevista. Cronômetro de 3 min, sem dicas e sem autocompletar

Ball

FácilClasses3 min

Write a class Ball. Its constructor takes the ball type and stores it in the field ballType. If no type is given, the ball gets the type 'regular'.

Exemplos

new Ball().ballType

Retorna 'regular'

new Ball('super').ballType

Retorna 'super'

Fonte

Carregando o editor...
  1. No argument gives a regular ball
  2. The type comes from the argument

Os testes ocultos rodam no envio