Access Array Data with Indexes - Issue

Access Array Data with Indexes - Issue
0

#1

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/


#2

Please provide a link to your challenge, always.


#3

Sure, sorry.


#4

No problem. read the example again and lmk if you still don’t get it


#5

var myData: myArray[0];
Is this not the solution? When i click Run the Tests, nothing happens


#6

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];

#7

ahhhh right!! thanks so much. CSS & HTML messed with my habits :smiley:


#8

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.


#9

Hahahhahaha I see :joy:


#10

I didn’t fully understand, can you give me keywords to search forum to find out more?


#11

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


#12

I see. thanks :heart:


#13

@Tchig and @Dadebayor You can always use Repl.it for JS challenges


#14

Oh, I like that, thank you!


#15

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?


#16

I think we can’t, it’s the basic design of repl.it, maybe they did that for a neat layout look


#17

It’s not that important so don’t spend time on it


#18

Alright thanks

  • 20 characters yet FCC?