Cursus Raku / Elementa / Positionalia data genera / Array

Quiz — Array

Est array:

my @data = 10, 20, 30, 40, 50;

Elementa Array

Quid sequentes lineae imprimunt?

10 say @data[0]; — (: 10, 20, 30, 40, 50 :) Noli oblivisci elementa numerari ab 0.
40 say @data[3]; — (: 10, 20, 30, 40, 50 :) Index 3 significat quartum element.
50 say @data[4]; — (: 10, 20, 30, 40, 50 :)  

Longitudo Array

Quid sequentes sententiae imprimunt?

5 say @data.elems; — (: 0, 1, 2, 3, 4, 5 :)  
5 say +@data; — (: 0, 1, 2, 3, 4, 5 :) Haec conversio dat magnitudinem array.
5 say +@data.elems; — (: 0, 1, 2, 3, 4, 5 :) Convertens resultatum @data.elems ad integrum, ergo nulla mutatio.

Cursus navigatio

Positionalia data genera   |   Positionalia data genera / Nidificata array


💪 Or jump directly to the exercises to this section.

Haec pagina automatice translata est per ChatGPT 4o. Originalis Anglicus textus

Translationes huius paginae: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська