What is the difference between an array and a dictionary?

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

How are these two ways of storing information handled internally in the engine?
What are the most common cases to use each of them?

Thank you for your time :)

:bust_in_silhouette: Reply From: jgodfrey

Array and Dictionary are fundamental data structures in many development languages, so most non-Godot references to this question are still valid (FYI).

Anyway, an Array generally provides random access to a sequential set of data, whereas a Dictionary is used to map between a set of keys and a set of values (so, very useful in mapping random “pairs” of information).

Here’s some additional context, but I’d encourage you to dig further…