mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 01:00:13 -04:00
chore(i18n,learn): processed translations (#54923)
This commit is contained in:
committed by
GitHub
parent
c2ad373b90
commit
0b16d2ce96
@@ -41,7 +41,7 @@ ourPets[1].names[0];
|
||||
|
||||
# --instructions--
|
||||
|
||||
Using dot and bracket notation, set the variable `secondTree` to the second element in the `list` array from the second object in the `myPlants` array.
|
||||
使用点和方括号,将变量 `secondTree` 的值设置为 `myPlants` 数组的第二个对象元素的 `list` 数组的第二个元素。
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ dashedName: manipulate-arrays-with-push
|
||||
|
||||
# --description--
|
||||
|
||||
An easy way to append data to the end of an array is via the `push()` method.
|
||||
一个将数据添加到数组末尾的简单方式是使用 `push()` 方法。
|
||||
|
||||
The `push()` method takes one or more <dfn>arguments</dfn> and appends them to the end of the array, in the order in which they appear. It returns the new length of the array.
|
||||
`push()` 方法需要一个或多个 <dfn>参数</dfn> 并将它们根据出现顺序追加到数组的末尾。 它返回数组的新长度。
|
||||
|
||||
示例:
|
||||
|
||||
@@ -23,7 +23,7 @@ const arr2 = ["Stimpson", "J", "cat"];
|
||||
arr2.push(["happy", "joy"]);
|
||||
```
|
||||
|
||||
`arr1` now has the value `[1, 2, 3, 4, 5]` and `arr2` has the value `["Stimpson", "J", "cat", ["happy", "joy"]]`.
|
||||
`arr1` 现在值为 `[1, 2, 3, 4, 5]`,`arr2` 的值为 `["Stimpson", "J", "cat", ["happy", "joy"]]`。
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ dashedName: record-collection
|
||||
- 你的函数必须始终返回整个 `records` 对象。
|
||||
- 如果 `value` 是空字符串,从专辑里删除指定的 `prop`。
|
||||
- 如果 `prop` 不是 `tracks`,并且 `value` 不是一个空字符串,将 `value` 赋给那个专辑的 `prop`。
|
||||
- If `prop` is `tracks` and `value` isn't an empty string, but the album doesn't have a `tracks` property, create an empty array and add `value` to it.
|
||||
- If prop is `tracks` and `value` isn't an empty string, add `value` to the end of the album's existing `tracks` array.
|
||||
- 如果 `prop` 是 `tracks` 并且 `value` 不是空字符串,但是专辑没有 `tracks` 属性,为该属性创建一个空数组并添加 `value` 作为其元素。
|
||||
- 如果 prop 是 `tracks` 并且 `value` 不是一个空字符串,将 `value` 添加到专辑现有 `tracks` 数组的末尾。
|
||||
|
||||
**注意:** 将 `recordCollection` 对象的副本用于测试。 你不应该直接修改 `recordCollection` 对象。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user