Open gnysek opened 1 month ago
this makes sense! i can also imagine this for array_insert()
Yes please add this
Adding it for array_delete as well could also make sense, since that has no return either
I've noticed that array_reverse_ext()
returns a real, whereas array_shuffle_ext()
does NOT, despite the fact that both keep the same number of valid array elements (as far as I understand).
IMO, array_shuffle_ext()
should also return a real, to make it consistent with the other "extended array functions" (apart from array_create_ext()
, which needs to return an array)
Is your feature request related to a problem?
I'm sometimes in situation where after adding struct values using
array_push
, I need to change some properties depending on user progress. I could of course change structs to already include it, but I've also came with an idea, that array_push would return current size of such array. So, instead of doing:I could do
Describe the solution you'd like
array_push()
could return new array size. Now it returns nothing.Describe alternatives you've considered
I can of course do:
But this means 3 lines of code instead 2 :)
Additional context
This is QoL change, that would save writing few characters :)
Edit:
array_insert
andarray_delete
could also get such change.