Best way to erase something in an array
-
Hello.
It’s my first time programming and it is really funny because it’s so difficult to do easy things. It’s just unbelievable. But I suppose it’s due to optimisation. I have no clue.I cannot find a way to get the index position of a value in the array. It’s weird because it’s so simple. The array index should have its value and we should be able to search either by value or by index position. But we can’t.
With loop I couldn’t figure out how it works.
So I made a new system by modifying the array 3 times.
First modify array (prepend value)
Second delete duplicates
Third delete first valueLike that, I can erase something from the array.
Do you know a better way to do that? I mean a proper way to do that?

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login