Not allowing different formats

let satellite = 'The Moon';

let galaxy = 'The Milky Way'

let stars = 'North Star'

function callMyNightSky() {

  return `nightsky ${satellite},${stars}, and ${galaxy}`;

}

console.log (callMyNightSky())

this format didn’t work but i think it has the same result is there a reason it wants the code a specific way

https://www.codecademy.com/courses/introduction-to-javascript/lessons/scope/exercises/global-scope

the approved format that worked for me

let satellite = 'The Moon';

let galaxy = 'The Milky Way'

let stars = 'North Star'

function callMyNightSky() {

 return 'Night Sky: ' + satellite + ', ' + stars + ', and ' + galaxy;

}

console.log (callMyNightSky())

You might try changing nightsky to Night Sky: . While it is possible that the SCT for the exercise is expecting you to use concatenation rather than interpolation, it’s more likely that your code isn’t accepted because the output doesn’t match what is expected. Looks like you’re missing a space as well.

ya i went back and fixed all the missing spaces and it worked. :upside_down_face:

1 Like