Explanation on how to do this


#1

Hi, i havent got this bit right, i dont know if its a bit complicated or if my brain is fogging hard or a bit of both…

a explanation instead of just the code would be very appreciated and thanks for your time already


#2

did you check the error in the output window? There is a problem with return. The shorthand you use will automatically return, so you don’t need to use the return keyword

if you do want to use the return keyword, don’t use this shorthand

i think you are pretty close to the solution.


#3

its telling me to pass a non arrow function as an argument to the .map()

can you explain this to me without giving me the code please

kind regards and thanks alot


#4

=> is the arrow function, it seems you can’t use that yet. It seems the exercise first wants you to write the full function, and then later refactor.


#5

am i going in the right direction or i got it completly wrong? because i dont know how to interpolate that to create a new array with the first letter of each string


#6

completely wrong. .map() is a function, there are multiple ways to use it. The exercise wants you to use the map function written full out, without an => shorthand. There isn’t much to explain about it, check from earlier exercise or documentation on how to write it


#7

am i going in the right direction now? whats wrong


#8

that is certainly a step in the right direction :slight_smile:

And you figured it out on your own, nicely done :slight_smile: Do pay close attention to how many parentheses you are using


#9

ive tried before to put another parentheses and then the error changes to unexpected token
can you help me understand the theory of this please… sorry to be bothering all the time


#10

why would you place the ) where you did? Is this a logic place?


#11

im not sure, but without it i was still getting the other error


#12

So you just inserted the closing parenthesise somewhere, and hoped it worked? That is not the way programming works. the ) you inserted closes the map function, where do you want to close your map function?


#13

i still cant figure inside my brain where i should be putting that )


#14

where you want your map function call to end.

Do you want me to tell you? Maybe look at documentation to see it? When looking at the docs, pay close attention to the parentheses


#15

Yes please… if i click on get the code on the exercise it goes forward through all steps it gave me the arrow function already


#16

line 6 should be:

})

we close the map function after the callback is completed.


#17

thanks for being so patient so far mate, the error changed now

i dont know how to set up the return to return each first letter of each string


#18

the map function provides access to each element in the array through a callback function, the parameter (message) of this callback function is what will contain each element of array, so what you need to manipulate.


#19

Can you please give me the Code for this bit, because if i click on get code on codeacademy it jumps steps and i wouldnt want to jump it without understanding how to return the first characters of the other array


#20

just do get answer then, i am not giving it. You can reset after getting the answer, and attempt it again