chore: replace forum links (#39139)

This commit is contained in:
Nicholas Carrigan
2020-06-30 01:51:26 -07:00
committed by GitHub
parent 34c26c4950
commit 1e0e54446f
365 changed files with 418 additions and 418 deletions

View File

@ -8,7 +8,7 @@ localeTitle: 矮胖的猴子
---
## Description
<section id="description">编写一个函数,将数组(第一个参数)拆分为<code>size</code>的长度(第二个参数),并将它们作为二维数组返回。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">编写一个函数,将数组(第一个参数)拆分为<code>size</code>的长度(第二个参数),并将它们作为二维数组返回。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 确认结束
---
## Description
<section id="description">检查字符串(第一个参数<code>str</code> )是否以给定的目标字符串(第二个参数, <code>target</code> )结束。这个挑战<em>可以</em>通过<code>.endsWith()</code>中引入的<code>.endsWith()</code>方法来解决。但是出于这个挑战的目的我们希望您使用其中一个JavaScript子字符串方法。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">检查字符串(第一个参数<code>str</code> )是否以给定的目标字符串(第二个参数, <code>target</code> )结束。这个挑战<em>可以</em>通过<code>.endsWith()</code>中引入的<code>.endsWith()</code>方法来解决。但是出于这个挑战的目的我们希望您使用其中一个JavaScript子字符串方法。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 对一个数字进行推理
---
## Description
<section id="description">返回提供的整数的阶乘。如果整数用字母n表示则阶乘是所有小于或等于n的正整数的乘积。因子通常用简写符号<code>n!</code>表示<code>n!</code>例如: <code>5! = 1 * 2 * 3 * 4 * 5 = 120</code>只有大于或等于零的整数才会被提供给该函数。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">返回提供的整数的阶乘。如果整数用字母n表示则阶乘是所有小于或等于n的正整数的乘积。因子通常用简写符号<code>n!</code>表示<code>n!</code>例如: <code>5! = 1 * 2 * 3 * 4 * 5 = 120</code>只有大于或等于零的整数才会被提供给该函数。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: Falsy Bouncer
---
## Description
<section id="description">从数组中删除所有有价值的值。 JavaScript中的Falsy值为<code>false</code> <code>null</code> <code>0</code> <code>&quot;&quot;</code> <code>undefined</code><code>NaN</code> 。提示:尝试将每个值转换为布尔值。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">从数组中删除所有有价值的值。 JavaScript中的Falsy值为<code>false</code> <code>null</code> <code>0</code> <code>&quot;&quot;</code> <code>undefined</code><code>NaN</code> 。提示:尝试将每个值转换为布尔值。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 找到字符串中最长的单词
---
## Description
<section id="description">返回所提供句子中最长单词的长度。您的回答应该是一个数字。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">返回所提供句子中最长单词的长度。您的回答应该是一个数字。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: Finders Keepers
---
## Description
<section id="description">创建一个查看数组第一个参数的函数并返回数组中传递真值测试的第一个元素第二个参数。如果没有元素通过测试则返回undefined。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">创建一个查看数组第一个参数的函数并返回数组中传递真值测试的第一个元素第二个参数。如果没有元素通过测试则返回undefined。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 突变
---
## Description
<section id="description">如果数组的第一个元素中的字符串包含数组第二个元素中字符串的所有字母则返回true。例如 <code>[&quot;hello&quot;, &quot;Hello&quot;]</code>应该返回true因为第二个字符串中的所有字母都出现在第一个字母中忽略大小写。参数<code>[&quot;hello&quot;, &quot;hey&quot;]</code>应返回false因为字符串“hello”不包含“y”。最后 <code>[&quot;Alien&quot;, &quot;line&quot;]</code>应该返回true因为“line”中的所有字母都出现在“Alien”中。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">如果数组的第一个元素中的字符串包含数组第二个元素中字符串的所有字母则返回true。例如 <code>[&quot;hello&quot;, &quot;Hello&quot;]</code>应该返回true因为第二个字符串中的所有字母都出现在第一个字母中忽略大小写。参数<code>[&quot;hello&quot;, &quot;hey&quot;]</code>应返回false因为字符串“hello”不包含“y”。最后 <code>[&quot;Alien&quot;, &quot;line&quot;]</code>应该返回true因为“line”中的所有字母都出现在“Alien”中。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 重复一个字符串重复字符串
---
## Description
<section id="description"><code>num</code> times第二个参数重复给定的字符串<code>str</code> (第一个参数)。如果<code>num</code>不是正数,则返回空字符串。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description"><code>num</code> times第二个参数重复给定的字符串<code>str</code> (第一个参数)。如果<code>num</code>不是正数,则返回空字符串。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 返回数组中的最大数字
---
## Description
<section id="description">返回一个数组该数组由每个提供的子数组中的最大数字组成。为简单起见提供的数组将包含4个子数组。请记住您可以使用简单的for循环遍历数组并使用数组语法<code>arr[i]</code>访问每个成员。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">返回一个数组该数组由每个提供的子数组中的最大数字组成。为简单起见提供的数组将包含4个子数组。请记住您可以使用简单的for循环遍历数组并使用数组语法<code>arr[i]</code>访问每个成员。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 反转字符串
---
## Description
<section id="description">反转提供的字符串。您可能需要先将字符串转换为数组,然后才能将其反转。您的结果必须是字符串。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">反转提供的字符串。您可能需要先将字符串转换为数组,然后才能将其反转。您的结果必须是字符串。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -9,7 +9,7 @@ localeTitle: 切片和拼接
---
## Description
<section id="description">您将获得两个数组和一个索引。使用数组方法<code>slice</code><code>splice</code>按顺序将第一个数组的每个元素复制到第二个数组中。开始在第二个数组的索引<code>n</code>处插入元素。返回结果数组。函数运行后,输入数组应保持不变。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">您将获得两个数组和一个索引。使用数组方法<code>slice</code><code>splice</code>按顺序将第一个数组的每个元素复制到第二个数组中。开始在第二个数组的索引<code>n</code>处插入元素。返回结果数组。函数运行后,输入数组应保持不变。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 标题案例句子
---
## Description
<section id="description">返回提供的字符串每个单词的首字母大写。确保单词的其余部分为小写。出于本练习的目的您还应该将诸如“the”和“of”之类的连接词大写。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">返回提供的字符串每个单词的首字母大写。确保单词的其余部分为小写。出于本练习的目的您还应该将诸如“the”和“of”之类的连接词大写。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 截断字符串
---
## Description
<section id="description">如果字符串(第一个参数)长于给定的最大字符串长度(第二个参数),则截断该字符串。返回带有<code>...</code>结尾的截断字符串。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">如果字符串(第一个参数)长于给定的最大字符串长度(第二个参数),则截断该字符串。返回带有<code>...</code>结尾的截断字符串。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 我属于哪里?
---
## Description
<section id="description">返回一个值(第二个参数)应该在排序后插入数组(第一个参数)的最低索引。返回的值应该是一个数字。例如, <code>getIndexToIns([1,2,3,4], 1.5)</code>应返回<code>1</code>因为它大于<code>1</code> 索引0但小于<code>2</code> 索引1。同样 <code>getIndexToIns([20,3,5], 19)</code>应返回<code>2</code>因为一旦数组已经排序,它将看起来像<code>[3,5,20]</code> <code>19</code>小于<code>20</code> 索引2并且大于<code>5</code> 指数1。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">返回一个值(第二个参数)应该在排序后插入数组(第一个参数)的最低索引。返回的值应该是一个数字。例如, <code>getIndexToIns([1,2,3,4], 1.5)</code>应返回<code>1</code>因为它大于<code>1</code> 索引0但小于<code>2</code> 索引1。同样 <code>getIndexToIns([20,3,5], 19)</code>应返回<code>2</code>因为一旦数组已经排序,它将看起来像<code>[3,5,20]</code> <code>19</code>小于<code>20</code> 索引2并且大于<code>5</code> 指数1。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 参数可选
---
## Description
<section id="description">创建一个将两个参数相加的函数。如果只提供了一个参数,则返回一个需要一个参数并返回总和的函数。例如, <code>addTogether(2, 3)</code>应返回<code>5</code> <code>addTogether(2)</code>应返回一个函数。使用单个参数调用此返回函数将返回总和: <code>var sumTwoAnd = addTogether(2);</code> <code>sumTwoAnd(3)</code>返回<code>5</code> 。如果任一参数不是有效数字则返回undefined。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">创建一个将两个参数相加的函数。如果只提供了一个参数,则返回一个需要一个参数并返回总和的函数。例如, <code>addTogether(2, 3)</code>应返回<code>5</code> <code>addTogether(2)</code>应返回一个函数。使用单个参数调用此返回函数将返回总和: <code>var sumTwoAnd = addTogether(2);</code> <code>sumTwoAnd(3)</code>返回<code>5</code> 。如果任一参数不是有效数字则返回undefined。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 二元代理商
---
## Description
<section id="description">返回传递的二进制字符串的英文翻译句子。二进制字符串将以空格分隔。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">返回传递的二进制字符串的英文翻译句子。二进制字符串将以空格分隔。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 转换HTML实体
---
## Description
<section id="description">将字符串中的字符<code>&amp;</code> <code>&lt;</code> <code>&gt;</code> <code>&quot;</code> (双引号)和<code>&#39;</code> 撇号转换为相应的HTML实体。如果卡住请记住使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。写下你的自己的代码。 </section>
<section id="description">将字符串中的字符<code>&amp;</code> <code>&lt;</code> <code>&gt;</code> <code>&quot;</code> (双引号)和<code>&#39;</code> 撇号转换为相应的HTML实体。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。写下你的自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 差分两个阵列
---
## Description
<section id="description">比较两个数组并返回一个新数组,其中只有在两个给定数组中的一个中找到的任何项,但不能同时返回两个数组。换句话说,返回两个数组的对称差异。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 <strong>注意</strong> <br>您可以按任何顺序返回包含其元素的数组。 </section>
<section id="description">比较两个数组并返回一个新数组,其中只有在两个给定数组中的一个中找到的任何项,但不能同时返回两个数组。换句话说,返回两个数组的对称差异。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 <strong>注意</strong> <br>您可以按任何顺序返回包含其元素的数组。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: DNA配对
---
## Description
<section id="description"> DNA链缺少配对元素。获取每个字符获取其对并将结果作为二维数组返回。 <a href="http://en.wikipedia.org/wiki/Base_pair" target="_blank">碱基对</a>是一对AT和CG。将缺少的元素与提供的字符匹配。将提供的字符作为每个数组中的第一个元素返回。例如对于输入GCG返回[[“G”“C”][“C”“G”][“G”“C”]]字符及其对在一个中配对数组,并将所有数组分组到一个封装数组中。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description"> DNA链缺少配对元素。获取每个字符获取其对并将结果作为二维数组返回。 <a href="http://en.wikipedia.org/wiki/Base_pair" target="_blank">碱基对</a>是一对AT和CG。将缺少的元素与提供的字符匹配。将提供的字符作为每个数组中的第一个元素返回。例如对于输入GCG返回[[“G”“C”][“C”“G”][“G”“C”]]字符及其对在一个中配对数组,并将所有数组分组到一个封装数组中。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 算了吧
---
## Description
<section id="description">给定数组<code>arr</code> 迭代并从第一个元素0索引开始删除每个元素直到函数<code>func</code>在迭代元素通过它时返回<code>true</code> 。然后在条件满足后返回数组的其余部分,否则, <code>arr</code>应作为空数组返回。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">给定数组<code>arr</code> 迭代并从第一个元素0索引开始删除每个元素直到函数<code>func</code>在迭代元素通过它时返回<code>true</code> 。然后在条件满足后返回数组的其余部分,否则, <code>arr</code>应作为空数组返回。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 一切都是真的
---
## Description
<section id="description">检查谓词(第二个参数)是否对集合的所有元素(第一个参数)都是<dfn>真实的</dfn> 。换句话说,您将获得一个对象的数组集合。谓语<code>pre</code>将一个对象的属性,你需要返回<code>true</code> ,如果它的值是<code>truthy</code> 。否则,返回<code>false</code> 。在JavaScript中 <code>truthy</code>值是在布尔上下文中计算时转换为<code>true</code>的值。请记住,您可以通过点表示法或<code>[]</code>表示法访问对象属性。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">检查谓词(第二个参数)是否对集合的所有元素(第一个参数)都是<dfn>真实的</dfn> 。换句话说,您将获得一个对象的数组集合。谓语<code>pre</code>将一个对象的属性,你需要返回<code>true</code> ,如果它的值是<code>truthy</code> 。否则,返回<code>false</code> 。在JavaScript中 <code>truthy</code>值是在布尔上下文中计算时转换为<code>true</code>的值。请记住,您可以通过点表示法或<code>[]</code>表示法访问对象属性。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -7,7 +7,7 @@ localeTitle: 做一个人
---
## Description
<section id="description">使用以下方法填写对象构造函数: <blockquote> getFirstNamegetLastNamegetFullNamesetFirstNamefirstsetLastNamelastsetFullNamefirstAndLast </blockquote>运行测试以查看每个方法的预期输出。采用参数的方法必须只接受一个参数,并且必须是一个字符串。这些方法必须是与对象交互的唯一可用方法。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">使用以下方法填写对象构造函数: <blockquote> getFirstNamegetLastNamegetFullNamesetFirstNamefirstsetLastNamelastsetFullNamefirstAndLast </blockquote>运行测试以查看每个方法的预期输出。采用参数的方法必须只接受一个参数,并且必须是一个字符串。这些方法必须是与对象交互的唯一可用方法。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -7,7 +7,7 @@ localeTitle: 映射碎片
---
## Description
<section id="description">返回一个新数组,将元素的平均高度转换为轨道周期(以秒为单位)。该数组将包含<code>{name: &#39;name&#39;, avgAlt: avgAlt}</code>格式的对象。您可以<a href="http://en.wikipedia.org/wiki/Orbital_period" target="_blank">在维基百科上</a>阅读有关轨道周期的<a href="http://en.wikipedia.org/wiki/Orbital_period" target="_blank">信息</a> 。值应四舍五入到最接近的整数。轨道上的身体是地球。地球半径为6367.4447公里地球的GM值为398600.4418 km <sup>3</sup> s <sup>-2</sup> 。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">返回一个新数组,将元素的平均高度转换为轨道周期(以秒为单位)。该数组将包含<code>{name: &#39;name&#39;, avgAlt: avgAlt}</code>格式的对象。您可以<a href="http://en.wikipedia.org/wiki/Orbital_period" target="_blank">在维基百科上</a>阅读有关轨道周期的<a href="http://en.wikipedia.org/wiki/Orbital_period" target="_blank">信息</a> 。值应四舍五入到最接近的整数。轨道上的身体是地球。地球半径为6367.4447公里地球的GM值为398600.4418 km <sup>3</sup> s <sup>-2</sup> 。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 遗失的信件
---
## Description
<section id="description">在传递的字母范围内找到丢失的字母并将其返回。如果范围内存在所有字母则返回undefined。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">在传递的字母范围内找到丢失的字母并将其返回。如果范围内存在所有字母则返回undefined。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 猪拉丁文
---
## Description
<section id="description">将提供的字符串翻译为pig latin。 <a href="http://en.wikipedia.org/wiki/Pig_Latin" target="_blank">Pig Latin</a>使用英语单词的第一个辅音或辅音簇将其移到单词的末尾并加上“ay”后缀。如果一个单词以元音开头你只需添加“way”到最后。输入字符串保证全部为小写英文单词。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">将提供的字符串翻译为pig latin。 <a href="http://en.wikipedia.org/wiki/Pig_Latin" target="_blank">Pig Latin</a>使用英语单词的第一个辅音或辅音簇将其移到单词的末尾并加上“ay”后缀。如果一个单词以元音开头你只需添加“way”到最后。输入字符串保证全部为小写英文单词。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 搜索和替换
---
## Description
<section id="description">使用提供的参数执行搜索并替换句子并返回新句子。第一个参数是执行搜索和替换的句子。第二个参数是你要替换的词(之前)。第三个参数是你将用(后)替换第二个参数。 <strong>注意</strong> <br>在更换原始单词时保留原始单词中第一个字符的大小写。例如如果您的意思是将“Book”替换为“dog”则应将其替换为“Dog”。如果卡住请记住使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">使用提供的参数执行搜索并替换句子并返回新句子。第一个参数是执行搜索和替换的句子。第二个参数是你要替换的词(之前)。第三个参数是你将用(后)替换第二个参数。 <strong>注意</strong> <br>在更换原始单词时保留原始单词中第一个字符的大小写。例如如果您的意思是将“Book”替换为“dog”则应将其替换为“Dog”。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 寻找和摧毁
---
## Description
<section id="description">您将获得一个初始数组(驱逐舰函数中的第一个参数),后跟一个或多个参数。从初始数组中删除与这些参数具有相同值的所有元素。 <strong>注意</strong> <br>你必须使用<code>arguments</code>对象。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">您将获得一个初始数组(驱逐舰函数中的第一个参数),后跟一个或多个参数。从初始数组中删除与这些参数具有相同值的所有元素。 <strong>注意</strong> <br>你必须使用<code>arguments</code>对象。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 最小的共同多重
---
## Description
<section id="description">找到所提供参数的最小公倍数可以均匀地除以这些参数以及这些参数之间范围内的所有序号。范围将是两个数字的数组不一定按数字顺序排列。例如如果给定1和3找到1和3的最小公倍数它们也可以被1到3 <em>之间</em>的所有数字整除。这里的答案是6.记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a>如果你得到卡住。尝试配对程序。编写自己的代码。 </section>
<section id="description">找到所提供参数的最小公倍数可以均匀地除以这些参数以及这些参数之间范围内的所有序号。范围将是两个数字的数组不一定按数字顺序排列。例如如果给定1和3找到1和3的最小公倍数它们也可以被1到3 <em>之间</em>的所有数字整除。这里的答案是6.记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a>如果你得到卡住。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 排序联盟
---
## Description
<section id="description">编写一个带有两个或更多数组的函数,并按原始提供的数组的顺序返回一个新的唯一值数组。换句话说,所有数组中存在的所有值都应包含在它们的原始顺序中,但在最终数组中没有重复。唯一编号应按其原始顺序排序,但最终数组不应按数字顺序排序。检查断言测试以获取示例。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">编写一个带有两个或更多数组的函数,并按原始提供的数组的顺序返回一个新的唯一值数组。换句话说,所有数组中存在的所有值都应包含在它们的原始顺序中,但在最终数组中没有重复。唯一编号应按其原始顺序排序,但最终数组不应按数字顺序排序。检查断言测试以获取示例。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 脊椎龙头套
---
## Description
<section id="description">将字符串转换为脊柱案例。脊柱情况是全小写单词连接的破折号。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">将字符串转换为脊柱案例。脊柱情况是全小写单词连接的破折号。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 压路机
---
## Description
<section id="description">展平嵌套数组。您必须考虑不同的嵌套级别。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">展平嵌套数组。您必须考虑不同的嵌套级别。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 求和范围中的所有数字
---
## Description
<section id="description">我们将通过两个数字的数组。返回这两个数字的总和加上它们之间所有数字的总和。最低的数字并不总是第一位。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">我们将通过两个数字的数组。返回这两个数字的总和加上它们之间所有数字的总和。最低的数字并不总是第一位。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 求所有奇数斐波纳契数
---
## Description
<section id="description">给定正整数<code>num</code> ,返回小于或等于<code>num</code>的所有奇数Fibonacci数的总和。 Fibonacci序列中的前两个数字是1和1.序列中的每个附加数字是前两个数字的总和。 Fibonacci序列的前六个数字是<code>sumFibs(10)</code>和8.例如, <code>sumFibs(10)</code>应该返回<code>10</code>因为小于或等于<code>10</code>所有奇数Fibonacci数都是<code>sumFibs(10)</code>和5.如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">给定正整数<code>num</code> ,返回小于或等于<code>num</code>的所有奇数Fibonacci数的总和。 Fibonacci序列中的前两个数字是1和1.序列中的每个附加数字是前两个数字的总和。 Fibonacci序列的前六个数字是<code>sumFibs(10)</code>和8.例如, <code>sumFibs(10)</code>应该返回<code>10</code>因为小于或等于<code>10</code>所有奇数Fibonacci数都是<code>sumFibs(10)</code>和5.如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: Sum All Primes
---
## Description
<section id="description">将所有素数加起来并包括所提供的数字。素数被定义为大于1的数并且只有两个除数一个和一个除数。例如2是素数因为它只能被1和2整除。提供的号码可能不是主要的。如果卡住请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">将所有素数加起来并包括所提供的数字。素数被定义为大于1的数并且只有两个除数一个和一个除数。例如2是素数因为它只能被1和2整除。提供的号码可能不是主要的。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 因此,你是艺术家
---
## Description
<section id="description">创建一个查看对象数组(第一个参数)的函数,并返回具有匹配的名称和值对的所有对象的数组(第二个参数)。如果要包含在返回的数组中,则源对象的每个名称和值对都必须存在于集合中的对象中。例如,如果第一个参数是<code>[{ first: &quot;Romeo&quot;, last: &quot;Montague&quot; }, { first: &quot;Mercutio&quot;, last: null }, { first: &quot;Tybalt&quot;, last: &quot;Capulet&quot; }]</code> ,第二个参数是<code>{ last: &quot;Capulet&quot; }</code> ,然后你必须从数组(第一个参数)返回第三个对象,因为它包含名称及其值,它作为第二个参数传递。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">创建一个查看对象数组(第一个参数)的函数,并返回具有匹配的名称和值对的所有对象的数组(第二个参数)。如果要包含在返回的数组中,则源对象的每个名称和值对都必须存在于集合中的对象中。例如,如果第一个参数是<code>[{ first: &quot;Romeo&quot;, last: &quot;Montague&quot; }, { first: &quot;Mercutio&quot;, last: null }, { first: &quot;Tybalt&quot;, last: &quot;Capulet&quot; }]</code> ,第二个参数是<code>{ last: &quot;Capulet&quot; }</code> ,然后你必须从数组(第一个参数)返回第三个对象,因为它包含名称及其值,它作为第二个参数传递。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 凯撒密码
---
## Description
<section id="description">最简单和最广为人知的<dfn>密码之一</dfn><code>Caesar cipher</code> ,也称为<code>shift cipher</code> 。在<code>shift cipher</code>中,字母的含义被移动一些设定量。一种常见的现代用途是<a href="https://en.wikipedia.org/wiki/ROT13" target="_blank">ROT13</a>密码其中字母的值移动了13个位置。因此&#39;A&#39;&#39;&#39;N&#39;&#39;B&#39;&#39;&#39;O&#39;等等。编写一个函数,它将<a href="https://en.wikipedia.org/wiki/ROT13" target="_blank">ROT13</a>编码的字符串作为输入并返回一个已解码的字符串。所有字母都是大写的。不要转换任何非字母字符(即空格,标点符号),但要传递它们。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">最简单和最广为人知的<dfn>密码之一</dfn><code>Caesar cipher</code> ,也称为<code>shift cipher</code> 。在<code>shift cipher</code>中,字母的含义被移动一些设定量。一种常见的现代用途是<a href="https://en.wikipedia.org/wiki/ROT13" target="_blank">ROT13</a>密码其中字母的值移动了13个位置。因此&#39;A&#39;&#39;&#39;N&#39;&#39;B&#39;&#39;&#39;O&#39;等等。编写一个函数,它将<a href="https://en.wikipedia.org/wiki/ROT13" target="_blank">ROT13</a>编码的字符串作为输入并返回一个已解码的字符串。所有字母都是大写的。不要转换任何非字母字符(即空格,标点符号),但要传递它们。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 收银机
---
## Description
<section id="description">设计一个收银抽屉功能<code>checkCashRegister()</code> ,它接受购买价格作为第一个参数( <code>price</code> ),支付作为第二个参数( <code>cash</code> ),以及现金抽屉( <code>cid</code> )作为第三个参数。 <code>cid</code>是列出可用货币的2D数组。 <code>checkCashRegister()</code>函数应始终返回带有<code>status</code>键和<code>change</code>键的对象。返回<code>{status: &quot;INSUFFICIENT_FUNDS&quot;, change: []}</code>如果出现的现金少于到期的更改,或者如果您无法返回确切的更改。返回<code>{status: &quot;CLOSED&quot;, change: [...]}</code>使用cash-in-drawer作为密钥<code>change</code>的值,如果它等于更改到期。否则,返回<code>{status: &quot;OPEN&quot;, change: [...]}</code> ,以硬币和账单中的更改到期,按从最高到最低的顺序排序,作为<code>change</code>密钥的值。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 <table class="table table-striped"><tbody><tr><th>货币单位</th><th></th></tr><tr><td>一分钱</td><td> 0.01美元PENNY </td></tr><tr><td></td><td> 0.05美元NICKEL </td></tr><tr><td>十分钱</td><td> 0.1美元DIME </td></tr><tr><td> 25美分硬币</td><td> 0.25美元(季) </td></tr><tr><td>美元</td><td> 1美元美元 </td></tr><tr><td>五美元</td><td> 5美元 </td></tr><tr><td>十美元</td><td> 10美元10日 </td></tr><tr><td>二十美元</td><td> 20美元二十美元 </td></tr><tr><td>一百元</td><td> 100美元一百 </td></tr></tbody></table></section>
<section id="description">设计一个收银抽屉功能<code>checkCashRegister()</code> ,它接受购买价格作为第一个参数( <code>price</code> ),支付作为第二个参数( <code>cash</code> ),以及现金抽屉( <code>cid</code> )作为第三个参数。 <code>cid</code>是列出可用货币的2D数组。 <code>checkCashRegister()</code>函数应始终返回带有<code>status</code>键和<code>change</code>键的对象。返回<code>{status: &quot;INSUFFICIENT_FUNDS&quot;, change: []}</code>如果出现的现金少于到期的更改,或者如果您无法返回确切的更改。返回<code>{status: &quot;CLOSED&quot;, change: [...]}</code>使用cash-in-drawer作为密钥<code>change</code>的值,如果它等于更改到期。否则,返回<code>{status: &quot;OPEN&quot;, change: [...]}</code> ,以硬币和账单中的更改到期,按从最高到最低的顺序排序,作为<code>change</code>密钥的值。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 <table class="table table-striped"><tbody><tr><th>货币单位</th><th></th></tr><tr><td>一分钱</td><td> 0.01美元PENNY </td></tr><tr><td></td><td> 0.05美元NICKEL </td></tr><tr><td>十分钱</td><td> 0.1美元DIME </td></tr><tr><td> 25美分硬币</td><td> 0.25美元(季) </td></tr><tr><td>美元</td><td> 1美元美元 </td></tr><tr><td>五美元</td><td> 5美元 </td></tr><tr><td>十美元</td><td> 10美元10日 </td></tr><tr><td>二十美元</td><td> 20美元二十美元 </td></tr><tr><td>一百元</td><td> 100美元一百 </td></tr></tbody></table></section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 回文检查
---
## Description
<section id="description">如果给定的字符串是回文,则返回<code>true</code> 。否则,返回<code>false</code><dfn>回文</dfn>是一个单词或句子,其拼写方式与前后相同,忽略标点符号,大小写和间距。 <strong>注意</strong> <br>您需要删除<strong>所有非字母数字字符</strong> (标点符号,空格和符号)并将所有内容转换为相同的大小写(小写或大写)以检查回文。我们会通过字符串具有不同的格式,如<code>&quot;racecar&quot;</code> <code>&quot;RaceCar&quot;</code><code>&quot;race CAR&quot;</code>等等。我们还将传递带有特殊符号的字符串,例如<code>&quot;2A3*3a2&quot;</code> <code>&quot;2A3 3a2&quot;</code><code>&quot;2_A3*3#A2&quot;</code> 。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
<section id="description">如果给定的字符串是回文,则返回<code>true</code> 。否则,返回<code>false</code><dfn>回文</dfn>是一个单词或句子,其拼写方式与前后相同,忽略标点符号,大小写和间距。 <strong>注意</strong> <br>您需要删除<strong>所有非字母数字字符</strong> (标点符号,空格和符号)并将所有内容转换为相同的大小写(小写或大写)以检查回文。我们会通过字符串具有不同的格式,如<code>&quot;racecar&quot;</code> <code>&quot;RaceCar&quot;</code><code>&quot;race CAR&quot;</code>等等。我们还将传递带有特殊符号的字符串,例如<code>&quot;2A3*3a2&quot;</code> <code>&quot;2A3 3a2&quot;</code><code>&quot;2_A3*3#A2&quot;</code> 。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 罗马数字转换器
---
## Description
<section id="description">将给定数字转换为罗马数字。所有<a href="http://www.mathsisfun.com/roman-numerals.html" target="_blank">罗马数字</a>答案都应以大写字母提供。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">将给定数字转换为罗马数字。所有<a href="http://www.mathsisfun.com/roman-numerals.html" target="_blank">罗马数字</a>答案都应以大写字母提供。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">

View File

@ -8,7 +8,7 @@ localeTitle: 电话号码验证器
---
## Description
<section id="description">如果传递的字符串看起来像有效的美国电话号码,则返回<code>true</code> 。用户可以按照他们选择的方式填写表单字段,只要其具有有效美国号码的格式即可。以下是美国数字的有效格式示例(有关其他变体,请参阅下面的测试): <blockquote> 555-555-5555 <br> (555)555-5555 <br> 555555-5555 <br> 555 555 5555 <br> 5555555555 <br> 1 555 555 5555 </blockquote>对于此挑战,您将看到一个字符串,如<code>800-692-7753</code><code>8oo-six427676;laskdjf</code> 。您的工作是根据上面提供的任何格式组合验证或拒绝美国电话号码。区号是必需的。如果提供了国家/地区代码,则必须确认国家/地区代码为<code>1</code> 。如果字符串是有效的美国电话号码,则返回<code>true</code> ;否则返回<code>false</code> 。如果卡住,请记得使用<a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
<section id="description">如果传递的字符串看起来像有效的美国电话号码,则返回<code>true</code> 。用户可以按照他们选择的方式填写表单字段,只要其具有有效美国号码的格式即可。以下是美国数字的有效格式示例(有关其他变体,请参阅下面的测试): <blockquote> 555-555-5555 <br> (555)555-5555 <br> 555555-5555 <br> 555 555 5555 <br> 5555555555 <br> 1 555 555 5555 </blockquote>对于此挑战,您将看到一个字符串,如<code>800-692-7753</code><code>8oo-six427676;laskdjf</code> 。您的工作是根据上面提供的任何格式组合验证或拒绝美国电话号码。区号是必需的。如果提供了国家/地区代码,则必须确认国家/地区代码为<code>1</code> 。如果字符串是有效的美国电话号码,则返回<code>true</code> ;否则返回<code>false</code> 。如果卡住,请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。尝试配对程序。编写自己的代码。 </section>
## Instructions
<section id="instructions">