We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c43c86 commit 07a56a2Copy full SHA for 07a56a2
doc/Type/Any.pod6
@@ -1153,6 +1153,23 @@ to return all but the last elements:
1153
1154
say (^10).head( * - 3 );# OUTPUT: «(0 1 2 3 4 5 6)»
1155
1156
+=head2 method tail
1157
+
1158
+Defined as:
1159
1160
+ multi method tail() is raw
1161
+ multi method tail($n)
1162
1163
+Returns the last or the list of the C<$n> last elements of an object. C<$n> can
1164
+be a C<Callable>, usually a C<WhateverCode>, which will be used to get all but
1165
+the first C<n> elements of the object.
1166
1167
+=for code
1168
+say (^12).reverse.tail ; # OUTPUT: «0»
1169
+say (^12).reverse.tail(3); # OUTPUT: «(2 1 0)»
1170
+say (^12).reverse.tail(*-7); # OUTPUT: «(4 3 2 1 0)»
1171
1172
1173
=head2 method tree
1174
1175
Defined as:
0 commit comments