From 9bca63754b92d8dd9324d2b7eb9433dd01e32430 Mon Sep 17 00:00:00 2001 From: Andrej Prskalo Date: Sun, 19 Nov 2023 21:09:15 +0100 Subject: [PATCH] added toReversed example --- src/guide/essentials/list.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/guide/essentials/list.md b/src/guide/essentials/list.md index 94800b697d..426c923353 100644 --- a/src/guide/essentials/list.md +++ b/src/guide/essentials/list.md @@ -431,4 +431,8 @@ Be careful with `reverse()` and `sort()` in a computed property! These two metho ```diff - return numbers.reverse() + return [...numbers].reverse() + +// Or you can use toReversed() method which returns +// a reversed copy of the original array ++ return numbers.toReversed() ```