JavaScript JavaScript Arrays Loop Through Arrays Array Methods

Answer Please!

script.js
const planets = ['Earth','Mars','Saturn','Mercury','Jupiter','Venus','Uranus','Neptune'];

1 Answer

Hi Chris!

This passes both:

const planets = ['Earth','Mars','Saturn','Mercury','Jupiter','Venus','Uranus','Neptune'];

const planetStr = planets.join(", ");
console.log(planetStr);

const pos = planets.indexOf('Saturn');
console.log(pos);

I hope that helps.

Stay safe and happy coding!