Access Array Data with Indexes - Issue

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/

1 Like

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

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

1 Like

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.

1 Like

Hahahhahaha I see :joy:

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

1 Like

I see. thanks :heart:

1 Like

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

2 Likes

Oh, I like that, thank you!

2 Likes

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

2 Likes

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

1 Like

Alright thanks

  • 20 characters yet FCC?
1 Like