Error when submitting an exercise

Hi, I was doing the “Space Age” exercise from the JavaScript path, but when compiling it, it gave the error “Your tests timed out.” I tried this code in another JavaScript compiler and it worked correctly. What could be happening?

the code is:


export const age = (planet, second) => {
  if (planet === 'earth') {
    return second / 31557600
  }
  else if (planet === 'mercury') {
    return second / (31557600 * 0.2408467)
  }
  else if (planet === 'venus') {
    return second / (31557600 * 	0.61519726)
  }
  else if (planet === 'mars') {
    return second / (31557600 * 1.8808158)
  }
  else if (planet === 'jupiter') {
    return second / (31557600 * 	11.862615)
  }
  else if (planet === 'saturn') {
    return second / (31557600 * 29.447498)
  }
  else if (planet === 'uranus') {
    return second / (31557600 * 84.016846)
  }
  else if (planet === 'neptune') {
    return second / (31557600 * 164.79132)
  }
  else  {
    throw new Error('not a planet');
  }
};

This may be related to the ongoing DDoS issues that Exercism is undergoing.

1 Like

just my luck first time trying this out :slight_smile:

See 🚨 Tests timing out? Read this for more information

1 Like

@surrational @Thewreex Try again now!

1 Like

Thank you very much it’s working!

1 Like