#Changing an array with a function

1 messages · Page 1 of 1 (latest)

violet olive
#

The title explains it all tbh

#

This is what I got with my logic but i can't seem to get it to be working if anyone could help me , Thank you

wet python
#

Hey, @violet olive, for any question like this, it really helps if you (a) include your entire code base(preferably in a Scrim, which is very easy to set up; you can just drag and drop your files from your computer into the scrim editor) and (b) state exactly what you're trying to do and what error or unexpected result you're encountering and what you'd like to achieve instead. Also, please remember to give people karma points if they take the time to help you.

violet olive
#

Oh I didn't know that , Ill remember that for the future and how do I give karma points?

wet python
#

Just giving a purple heart like that. If it's your first karma point, you're now 1/250 of the way to earning a Scrimba hoodie 😂

#

(I don't think I or a lot other people really care about the hoodie, but it's just a nice little symbolic gesture on this server... but yeah, I know that people don't know about it unless they spend much time here)

violet olive
violet olive
wet python
#

It's because your file names are messed up; take a look at those

violet olive
#

huh , I don't see anything wrong

wet python
violet olive
#

lemme resend it maybe

#

here it works now

#

And what I am trying to do is toggling the characters / whatever the button says and doing so by changing the array in the characters value

wet python
#

You're still getting an error in the Scrim editor because you originally created the first file as a CSS file and the editor is still expecting it to be CSS even though you've renamed it. Just delete app.js and create it again, as a .js file this time, and paste in your content. Also, put in the latest version of your code so that I (or someone else) can see what you're currently working on within the context of the rest of your code.

I've got to go run an errand, but I'll check back later if no one else has responded. But yeah, I'm saying all this as stuff not just to do with this project but any project you're trying to get help with on here

violet olive
#

oh okay

#

Thanks

#

Latest scrim

wet python
#

At a brief glance, I can see one problem: you're redefining the characters array with the toggles, but at the top, you've declared the array as a constant via const. Declare it with let instead of const for starters...Alright now, I gotta go for real now, but maybe that will get the ball rolling for you

violet olive
#

Oh , Ye i didn't really know the difference between them

#

Dude you are such a life saver

#

That right there fixed my entire code

#

thank you so much

wet python
#

No problem... And yeah, it's a pretty important difference. Const = constant = "I want this thing to constantly be the same" Let = "I want to let this thing change"