summaryrefslogtreecommitdiffstats
path: root/doc/classes/PackedStringArray.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/PackedStringArray.xml')
-rw-r--r--doc/classes/PackedStringArray.xml4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml
index f1b02272f3..621831c7a3 100644
--- a/doc/classes/PackedStringArray.xml
+++ b/doc/classes/PackedStringArray.xml
@@ -11,9 +11,11 @@
var string = " ".join(string_array)
print(string) # "hello world"
[/codeblock]
+ [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedStringArray] versus [code]Array[String][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays.
+ [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again.
</description>
<tutorials>
- <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
+ <link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link>
</tutorials>
<constructors>
<constructor name="PackedStringArray">