-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
fix: 「配列」の章における typo などを修正 #1583
Conversation
✅ Deploy Preview for js-primer ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
const sparseArray = [1,, 3]; | ||
const sparseArray = [1, , 3]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[1,,3]
または [1, , 3]
のいずれかでないとスペースの置き方としておかしいと思いました。章の後半の
js-primer/source/basic/array/README.md
Line 213 in 4170c29
const sparseArray = [1, , 3]; |
などで後者の書き方がされていたため、そちらに合わせました。
// 引数なしは 1 を指定した場合と同じ | ||
// 引数なしは1を指定した場合と同じ | ||
console.log(array.flat()); // => [["A"], "B", "C"] | ||
console.log(array.flat(1)); // => [["A"], "B", "C"] | ||
console.log(array.flat(2)); // => ["A", "B", "C"] | ||
// すべてをフラット化するには Infinity を渡す | ||
// すべてをフラット化するにはInfinityを渡す |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
js-primer の文章(コメントなども含む)では数字や英単語のまわりにスペースを置く書き方はしていないと思いますが、なぜかここではスペースがありました。一貫性を保つため削除しました。
@@ -537,7 +537,6 @@ console.log(array.flat()); // => ["A", "B", "C"] | |||
`splice`メソッドを利用すると、削除した要素を自動で詰めることができます。 | |||
`splice`メソッドは指定したインデックスから、指定した数だけ要素を取り除き、必要ならば要素を同時に追加できます。 | |||
|
|||
{{book.console}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここは実行されることを意図したプログラムではないと思うので、削除しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今気付きましたが、#1582 の issue と同内容のようです。
ありがとうございます |
「配列」の章において何点か誤記や記述が一貫性を欠く箇所などを見つけたため、修正しました。