object
with various properties
, now you'll see how to access the values of those properties
. Here's an example:
let duck = {Dot notation is used on the
name: "Aflac",
numLegs: 2
};
console.log(duck.name);
// This prints "Aflac" to the console
object
name, duck
, followed by the name of the property
, name
, to access the value of "Aflac".
properties
of the dog
object below to your console.
console.log
to print the value for the name
property of the dog
object.
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: Your should use console.log
to print the value for the numLegs
property of the dog
object.
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.'');'
```