Why are we not using things that have been covered?


#1

I’m trying to understand why in earlier courses we are taught better methods of doing things, and they are then promptly ignored. case and point:
https://www.codecademy.com/courses/learn-javascript-scope/lessons/scope/exercises/global-scope

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

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

console.log(myNightSky());

Instead of this:

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

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

console.log(myNightSky());

I have also tried using the ternary operators in other examples only to be rebuffed.
Why teach us something if we cannot use it in our answers?


#2

#3

Topic has been unlisted until such time a link to the exercise is posted. Please comply so that you might get the answer you seek. Thanks.


#4

I’ve updated it with a link.


#5

#6

A lot has to do with the limited focus of the SCT, and it may well be the author wishes to demonstrate both forms. If something is unexpected by the lesson checker, even if it is valid code, it may still be rejected. Many things we learn are not replacements for earlier concepts, just another way of doing things. A little tolerance for the quirkiness of these lessons will go a long way. Please bear with it.


#7

Cool, so its more of a lack of ability of the program to check for different permutations of the answers, and less with incorrect coding.

That’s fine then, I’ll use a third party IDE on my pc to test my code if it doesn’t pass muster on the system.

Thanks.


#8

Without logging in, we can still use REPL . IT as a sandbox. If you want your code to be saved, log in first.


#10