JS Assigning a value to a variable within a short term function

Hey… I’m learning JS right now, and since I learned Python before, now I take use of the short term programming.

Well… the function “logcitySkyline” is the main exercise.
Now I wanted to use logCitySkyline2 to be a short term function. But I’m stuck on assigning the string “Empire State Building” to it.
I tried
= skyscraper = “ESB” =>, let skyscraper = “ESB” => and stuff, but nothing of this worked… Is it even possible to give a variable an value in such a short term function?

const city = "New York City";

function logCitySkyline() {

  let skyscraper = "Empire State Building";

  return `The stars over the ${skyscraper} in ${city}`;


const logCitySkyline2 = skyscraper  => `The stars over the ${skyscraper} in ${city}`;



Thank you for your help

That’s because skyscraper is a parameter you’re saying is going to be passed in const logCitySkyline2 = skyscraper => ... which can also be written as const logCitySkyline2 = (skyscraper) => ... with the same effect…

and then when you invoke the function pass in the values logCitySkyline2("tallbuilding");

Thanks… with your help, I achieved it:

const city = "New York City";
const logCitySkyline2 = skyscraper => `The stars over the ${skyscraper} in ${city}`;
console.log(logCitySkyline2("Empire State Building")); // Output: The stars over the Empire State Building in New York City