<code>Objects</code> can have a special type of <code>property</code>, called a <code>method</code>.
<code>Methods</code> are <code>properties</code> that are functions. This adds different behavior to an <code>object</code>. Here is the <code>duck</code> example with a method:
<blockquote>let duck = {<br> name: "Aflac",<br> numLegs: 2,<br> sayName: function() {return "The name of this duck is " + duck.name + ".";}<br>};<br>duck.sayName();<br>// Returns "The name of this duck is Aflac."</blockquote>
The example adds the <code>sayName</code><code>method</code>, which is a function that returns a sentence giving the name of the <code>duck</code>.
Notice that the <code>method</code> accessed the <code>name</code> property in the return statement using <code>duck.name</code>. The next challenge will cover another way to do this.
</section>
## Instructions
<sectionid='instructions'>
Using the <code>dog</code><code>object</code>, give it a method called <code>sayLegs</code>. The method should return the sentence "This dog has 4 legs."
</section>
## Tests
<sectionid='tests'>
```yml
- text: <code>dog.sayLegs()</code> should be a function.
testString: 'assert(dog.sayLegs() === ''This dog has 4 legs.'', ''<code>dog.sayLegs()</code> should return the given string - note that punctuation and spacing matter.'');'