Code Lab

Modo entrevista. Temporizador de 3 min, sin pistas y sin autocompletado

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'.

Ejemplos

new Ball().ballType

Devuelve 'regular'

new Ball('super').ballType

Devuelve 'super'

Fuente

Cargando el editor…
  1. No argument gives a regular ball
  2. The type comes from the argument

Las pruebas ocultas se ejecutan al enviar