Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite

Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working.

* fix: ran script, updated testStrings and solutions
2020-03-03 18:49:47 +05:30

1.5 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
56533eb9ac21ba0edf2244c0 Global vs. Local Scope in Functions 1 功能中的全局与局部范围

Description

可以使本地变量和全局变量具有相同的名称。执行此操作时, local变量优先于global变量。在这个例子中:
var someVar =“帽子”;
function myFun{
var someVar =“Head”;
返回someVar;
}
函数myFun将返回"Head"因为存在变量的local版本。

Instructions

将一个局部变量添加到myOutfit函数,以使用"sweater"覆盖outerWear的值。

Tests

tests:
  - text: 不要更改全局<code>outerWear</code>的值
    testString: assert(outerWear === "T-Shirt");
  - text: <code>myOutfit</code>应该返回<code>&quot;sweater&quot;</code>
    testString: assert(myOutfit() === "sweater");
  - text: 不要更改return语句
    testString: assert(/return outerWear/.test(code));

Challenge Seed

// Setup
var outerWear = "T-Shirt";

function myOutfit() {
  // Only change code below this line



  // Only change code above this line
  return outerWear;
}

myOutfit();

Solution

// solution required