In “Basic JavaScript: Access Array Data with Indexes” challenge, i click “Run the Tests” and nothing happens. The icons remain stock, they don’t show X as they should if my code is failing.
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/access-array-data-with-indexes/
Please provide a link to your challenge, always.
Sure, sorry.
No problem. read the example again and lmk if you still don’t get it
var myData: myArray[0];
Is this not the solution? When i click Run the Tests, nothing happens
You’re so close that I’ll give you the solution:
You have
Now, it just so happens that
:
should be replaced by
=
for myData to EQUAL your accessed value in myArray.
That is to say:
var myData=myArray[0];
ahhhh right!! thanks so much. CSS & HTML messed with my habits
Also, try using the console next time. Click F12 if you’re using chrome (otherwise google it) and paste all your code with a
console.log()
; statement with the variable or any other datatype that you’re not 100% sure what it is.
In this case, that would mean:
console.log(myData);
at the end of your code, pasted and run in the console.
Hahahhahaha I see
I didn’t fully understand, can you give me keywords to search forum to find out more?
Console.log
Debugging
https://www.w3schools.com/js/tryit.asp?filename=tryjs_output_console
https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors
https://www.w3schools.com/js/js_output.asp Look at bottom of page in this page
I see. thanks
Oh, I like that, thank you!
Can you see the array logged in repl.it?
Is there any way to trim the look of it so that it doesn’t begin and end with spaces?
I think we can’t, it’s the basic design of repl.it, maybe they did that for a neat layout look
It’s not that important so don’t spend time on it
Alright thanks
- 20 characters yet FCC?