Im confused as to why my answer doesnt mark off as green despite getting the correct answer in the console.
the codecadamy official answer is
but we never even declared someting called num???
Im confused as to why my answer doesnt mark off as green despite getting the correct answer in the console.
the codecadamy official answer is
but we never even declared someting called num???
Using the same name for your function parameter is a bad idea/practice
num
is a parameter, parameters are defined along with the function. the .map
method will then call your function and provide arguments/values for your parameters
Hi everyone,
I misread the use of iterators and I thought that the parameter had to be identical to the name of the array (since I understood that it should not be the case). But I did some little experiments on my side and got the following results that I canāt figure out:
When I run the code I donāt get any errors, how is this possible? Yet helloWorld is a const global variable, I shouldnāt be able to reassign it in the function.
And then why when I print helloWorld, is it its old name?
Iām maybe just too curious. Thanks all.
I had the same question. The names seem like a good choice for someone experienced. Iād rather have named it numbersAsArray vs numberAsArgument or something. For total beginners even small stuff like this can start making us feel like weāre in Math class in 1995 where things are implied and you give up learning because you can never seem to keep up with everything implied.