Skip to content

💄 update reverse array example to modern syntax #3268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

lregaladohdez
Copy link

Description of Problem

This is not a problem but a stylistic suggestion.

The example currently uses [...array].reverse(), which can be simplified using a more modern and concise syntax.

Proposed Solution

Suggest using the simpler:

array.toReversed()

This achieves the same result reversing the array without mutating the original, but in a cleaner and more modern way.

Additional Information

array.toReversed() was introduced in ECMAScript 2023

Suggest `arr.toReversed()` instead of construction `[...array].reverse()` offering a more modern and simpler solution
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit c7db91b
🔍 Latest deploy log https://app.netlify.com/projects/vuejs/deploys/687caedbfab8240008cd5f6b
😎 Deploy Preview https://deploy-preview-3268--vuejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@brc-dd
Copy link
Member

brc-dd commented Aug 25, 2025

closing for same reason as #2575

toReversed is a baseline 2023 feature and vite's default target is baseline-widely-available. If you use toReversed it won't work in some browsers without a polyfill.

@brc-dd brc-dd closed this Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants