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');
}
};