freeCodeCamp/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.chinese.md

1.1 KiB

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
56533eb9ac21ba0edf2244a9 Initializing Variables with the Assignment Operator 1 使用赋值运算符初始化变量

Description

通常将变量初始化为与声明的同一行中的初始值。 var myVar = 0;创建一个名为myVar的新变量,并为其指定初始值0

Instructions

使用var定义变量a并将其初始化为值9

Tests

tests:
  - text: 将<code>a</code>初始化为值<code>9</code>
    testString: 'assert(/var\s+a\s*=\s*9\s*/.test(code), "Initialize <code>a</code> to a value of <code>9</code>");'

Challenge Seed

// Example
var ourVar = 19;

// Only change code below this line

After Test

console.info('after the test');

Solution

// solution required