<commit_before>---
id: 587d7dac367417b2b2512b74
title: Use Dot Notation to Access the Properties of an Object
challengeType: 1
---

## Description
<section id='description'>
The last challenge created an <code>object</code> with various <code>properties</code>, now you'll see how to access the values of those <code>properties</code>. Here's an example:
<blockquote>let duck = {<br>&nbsp;&nbsp;name: "Aflac",<br>&nbsp;&nbsp;numLegs: 2<br>};<br>console.log(duck.name);<br>// This prints "Aflac" to the console</blockquote>
Dot notation is used on the <code>object</code> name, <code>duck</code>, followed by the name of the <code>property</code>, <code>name</code>, to access the value of "Aflac".
</section>

## Instructions
<section id='instructions'>
Print both <code>properties</code> of the <code>dog</code> object below to your console.
</section>

## Tests
<section id='tests'>

```yml
tests:
  - text: Your should use <code>console.log</code> to print the value for the <code>name</code> property of the <code>dog</code> object.
    testString: assert(/console.log\(.*dog\.name.*\)/g.test(code), 'Your should use <code>console.log</code> to print the value for the <code>name</code> property of the <code>dog</code> object.');
  - text: Your should use <code>console.log</code> to print the value for the <code>numLegs</code> property of the <code>dog</code> object.
    testString: assert(/console.log\(.*dog\.numLegs.*\)/g.test(code), 'Your should use <code>console.log</code> to print the value for the <code>numLegs</code> property of the <code>dog</code> object.');

```

</section>

## Challenge Seed
<section id='challengeSeed'>

<div id='js-seed'>

```js
let dog = {
  name: "Spot",
  numLegs: 4
};
// Add your code below this line


```

</div>



</section><commit_msg>fix: Object Oriented Programming: Use Dot Notation to Access the Properties of an Object (#34675)<commit_after>---
id: 587d7dac367417b2b2512b74
title: Use Dot Notation to Access the Properties of an Object
challengeType: 1
---

## Description
<section id='description'>
The last challenge created an <code>object</code> with various <code>properties</code>, now you'll see how to access the values of those <code>properties</code>. Here's an example:
<blockquote>let duck = {<br>&nbsp;&nbsp;name: "Aflac",<br>&nbsp;&nbsp;numLegs: 2<br>};<br>console.log(duck.name);<br>// This prints "Aflac" to the console</blockquote>
Dot notation is used on the <code>object</code> name, <code>duck</code>, followed by the name of the <code>property</code>, <code>name</code>, to access the value of "Aflac".
</section>

## Instructions
<section id='instructions'>
Print both <code>properties</code> of the <code>dog</code> object below to your console.
</section>

## Tests
<section id='tests'>

```yml
tests:
  - text: Your code should use <code>console.log</code> to print the value for the <code>name</code> property of the <code>dog</code> object.
    testString: assert(/console.log\(.*dog\.name.*\)/g.test(code));
  - text: Your code should use <code>console.log</code> to print the value for the <code>numLegs</code> property of the <code>dog</code> object.
    testString: assert(/console.log\(.*dog\.numLegs.*\)/g.test(code));

```

</section>

## Challenge Seed
<section id='challengeSeed'>

<div id='js-seed'>

```js
let dog = {
  name: "Spot",
  numLegs: 4
};
// Add your code below this line


```

</div>



</section>
{'fraction_non_alphanumeric': 0.1671071953010279, 'fraction_numerical': 0.013215859030837005, 'mean_word_length': 4.802385008517888, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 109, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4051199', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1111, 'n_words': 361}