Array invert()

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Firty

There is no invert in the array object anymore… How can I invert an array now?

:bust_in_silhouette: Reply From: jgodfrey

Do you mean reverse()? There was (in 3.5) and still is (in 4.0) an Array.reverse().

I just asked the GPT chat lol, on Google I didn’t find anything about it, but that’s it, they changed it to reverse(). Thanks.

Firty | 2023-03-06 20:59

To be clear, it hasn’t been renamed. It was, and still is, reverse(). A classic case of ChatGPT confidently and happily providing incorrect information. :frowning:

jgodfrey | 2023-03-06 21:09

Agreed, seen it all over Reddit and the problem, new programmers believe it’s a band-aid that cures all while in fact its just another tool to be used.

And tools only perform as well as the person using them.

Wakatta | 2023-03-07 02:59

You are not exactly correct. There is invert method in godot 3.x (Array — Godot Engine (3.6) documentation in English ), I actually had to rename it to reverse while migrating to 4.0

crazymeow | 2023-03-10 15:23

Hmmm… thanks @crazymeow. You are (obviously) correct. My memory seems faulty in this case. I vaguely remember verifying this in the docs before responding, but I was apparently looking at the wrong docs version… :frowning:

jgodfrey | 2023-03-10 15:28