I can't see the error in sky.js

Hello, I have an error in the global scope task sky.js

https://www.codecademy.com/courses/learn-javascript-scope/lessons/scope/exercises/global-scope?action=lesson_resume&course_redirect=introduction-to-javascript

The errors are flagged at the fourth task.

Does the code contain a function named myNightSky() defined with const?
Did you write a console.log() statement beneath the close of the function block?
Did you pass the myNightSky() function to console.log() as an argument?

const satellite = 'The Moon';
const galaxy = 'The Milky Way';
let stars = 'North Star';

const myNightSky = () => `Night Sky: ${satellite}, ${stars}, ${galaxy}`;

console.log(myNightSky()); 


const myNightSky = () => {
return 'Night Sky: ’ + satellite + ', ’ + stars + ', ’ + galaxy;
}

Thanks. It worked. But codecademy should be able to accept different styles
of function expression. After all they taught that form in the functions
topic.

Thanks again.

Actually, I have just tried your solution again and it works the same. Could it be the browser that you’re using to connect to codecademy?

It is also annoying that they let you use ` in defining sometimes and then will cry that it isn’t inside of a ’ in others.

It accepted this for question 2:

const satellite = ‘The Moon’;
const galaxy = ‘The Milky Way’;
let stars = ‘North Star’;

const myNightSky = () => 'Night Sky: ’ + satellite + ', ’ + stars + ', ’ + galaxy;

But gave me the same errors for Question 3 with this:

const satellite = ‘The Moon’;
const galaxy = ‘The Milky Way’;
let stars = ‘North Star’;

const myNightSky = () => 'Night Sky: ’ + satellite + ', ’ + stars + ', ’ + galaxy;

console.log (myNightSky());

Why?

I don’t know, perhaps. I’ve always used chrome.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.