You're not too far off in concept. I think calling it "creating" or "assigning" variables will just confuse you though.
It's more adding/removing/modifying values in a data structure (in this case, just an array).
I made a simple example for you to hopefully answer some of the more specific details you may be struggling with.
I'll note that this is not production level code. A few things (of many) to improve:
I finished my project a few hours ago, thanks!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You're not too far off in concept. I think calling it "creating" or "assigning" variables will just confuse you though.
It's more adding/removing/modifying values in a data structure (in this case, just an array).
I made a simple example for you to hopefully answer some of the more specific details you may be struggling with.
I'll note that this is not production level code. A few things (of many) to improve:
I finished my project a few hours ago, thanks!