Learn Basic String and Array Methods by Building a Music Player - Step 41

Tell us what’s happening:

I am having trouble with step 41 on creating a arrow function

Your code so far

getCurrentSongIndex = () =>

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0

Challenge Information:

Learn Basic String and Array Methods by Building a Music Player - Step 41

  1. You need to declare the variable using const or let

  2. You should include the function body.

const fn = () => {}

what is the difference between let and const in this problem

It wouldn’t be anything specific to this step. You can declare the function both ways.


Personally, I prefer functions to be declared using const as it signals something different from let and I find it quicker to read code that makes that distinction (reassignable vs non-reassignable).

I know a lot of people have started to use let for everything. The main argument is, it is faster to type let.

MDN: declarations

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