JavaScript JavaScript Arrays Loop Through Arrays Array Methods

final string

Feedback: have you logged the finale string..???

console.log(planets.indexOf('Saturn '));

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

const planetsString = planets.join(', ');

console.log (planets.indexOf ('Saturn'));

1 Answer

Hey Rogier Bogaards,

You don't have to create any new variables for this challenge. You can log the final string value like this:

const planets = ['Earth','Mars','Saturn','Mecury','Jupiter','Venus','Uranus','Neptune'];
console.log(planets.join(', '));

console.log(planets.indexOf('Saturn'));

Hope this helps!

thnx mate!