properties的object ,现在您将看到如何访问这些properties的值。这是一个例子: 让duck = {点符号用于
名称:“Aflac”,
numLegs:2
};
的console.log(duck.name);
//这会将“Aflac”打印到控制台
object名称duck ,后跟property name ,以访问“Aflac”的值。 dog对象的两个properties打印到控制台。 console.log来打印dog对象的name属性的值。
testString: 'assert(/console.log\(.*dog\.name.*\)/g.test(code), "Your should use console.log to print the value for the name property of the dog object.");'
- text: 您应该使用console.log来打印dog对象的numLegs属性的值。
testString: 'assert(/console.log\(.*dog\.numLegs.*\)/g.test(code), "Your should use console.log to print the value for the numLegs property of the dog object.");'
```