aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/array-flatten.md
AgeCommit message (Collapse)AuthorFilesLines
7 daysinterpreter: Add a flatten() method to arraysDylan Baker1-0/+5
This allows users to do two things, flatten potentially nested arrays themselves, and, to safely convert types that may be an array to not an array. ```meson x = [meson.get_external_property('may_be_array)].flatten() ``` ```meson x = ['a', ['b', 'c']] assert(x.flatten() == ['a', 'b', 'c']) ```