Skip to content
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

feat(array): Change Array by copyの対応 #1679

Merged
merged 19 commits into from
Jul 30, 2023
Merged

feat(array): Change Array by copyの対応 #1679

merged 19 commits into from
Jul 30, 2023

Conversation

azu
Copy link
Collaborator

@azu azu commented Jul 10, 2023

概要

配列の破壊的なメソッドであるsplicereversesortに対して、
ES2023では非破壊的なバージョンであるtoSplicedtoReversedtoSortedが追加されました。

また、配列への代入(array[index] = item)という破壊的な処理に対して、withという非破壊的なメソッドが追加されました。

ページ

変更内容

  • 破壊的なメソッドと非破壊的なメソッド のセクション
    • 追加されたsplicereversesortwithメソッドの解説の追加
    • 破壊的な方法と非破壊的な方法の対応関係を追加
破壊的な方法 非破壊な方法
array[index] = item Array.prototype.with[ES2023]
Array.prototype.pop array.slice(0, -1)array.at(-1)[ES2022]
Array.prototype.push [...array, item][ES2015]
Array.prototype.splice Array.prototype.toSpliced[ES2023]
Array.prototype.reverse Array.prototype.toReversed[ES2023]
Array.prototype.sort Array.prototype.toSorted[ES2023]
Array.prototype.shift array.slice(1)array.at(0)[ES2022]
Array.prototype.unshift [item, ...array][ES2015]
Array.prototype.copyWithin[ES2015] なし
Array.prototype.fill[ES2015] なし

関連

Preview

@azu azu linked an issue Jul 10, 2023 that may be closed by this pull request
1 task
@azu azu added Type: Feature Lang: ES2023 ECMAScript 2023 labels Jul 10, 2023
@bot-user
Copy link

bot-user commented Jul 10, 2023

Deploy Preview for js-primer ready!

Name Link
🔨 Latest commit bd52b88
🔍 Latest deploy log https://app.netlify.com/sites/js-primer/deploys/64c6764e41df250009c60ed8
😎 Deploy Preview https://deploy-preview-1679--js-primer.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 site configuration.

source/basic/array/README.md Outdated Show resolved Hide resolved
@azu azu marked this pull request as ready for review July 11, 2023 03:36
@azu azu merged commit 60c7676 into master Jul 30, 2023
@azu azu deleted the feature/1667 branch July 30, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ES2023: Change Array by copy
2 participants