From 3fb6f2f2602124949da35e1b118a9b9c9b20e34c Mon Sep 17 00:00:00 2001 From: Yuriy Panarin Date: Fri, 9 Feb 2024 01:58:51 +0100 Subject: [PATCH] docs(language-definition.md) - add reverse function --- docs/language-definition.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/language-definition.md b/docs/language-definition.md index 3b72c083..e5267f9a 100644 --- a/docs/language-definition.md +++ b/docs/language-definition.md @@ -713,6 +713,15 @@ Returns the first `n` elements from an array. If the array has fewer than `n` el take([1, 2, 3, 4], 2) == [1, 2] ``` +### reverse(array) {#reverse} + +Return new reversed copy of the array. + +```expr +reverse([3, 1, 4]) == [4, 1, 3] +reverse(reverse([3, 1, 4])) == [3, 1, 4] +``` + ### sort(array[, order]) {#sort} Sorts an array in ascending order. Optional `order` argument can be used to specify the order of sorting: `asc`