Skip to content

Archive

Programming Languages

1 articles
Software Engineering 19 Sep 2026 5 min read

Array Syntax in Go, PHP, JavaScript, Kotlin, Rust, and Python

Square brackets make array code look deceptively portable. In Rust, [10, 20, 30] can be a fixed-size array whose length is part of its type. In Python, the same visual shape creates a mutable list. PHP uses bracket syntax for an ordered map, while JavaScript creates a resizable Array object. The syntax is easy to memorize. The more important distinction is what the value means after it has been created.