How to set volume of audio object?
<p>I know that i can create an audio object like this:</p>

<pre><code>var audio = new Audio("test.wav");
</code></pre>

<p>And i know how i can play the audio:</p>

<pre><code>audio.play();
</code></pre>

<p>I used the following <code>for</code> loop to output all functions from <code>audio</code>:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var myAudioObject = new Audio();

for (var key in myAudioObject)
{
   if (typeof myAudioObject[key] === "function")
   {
       console.log(key);
   }
}</code></pre>
</div>
</div>
</p>

<p>But there is no setting for volume. Is it possible to change the volume in the audio object?</p>

<hr>

<p><strong>HINT</strong></p>

<p>It was my fault. If i replace <code>function</code> in my for loop with <code>number</code> then i find volume.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var myAudioObject = new Audio();

for (var key in myAudioObject)
{
   if (typeof myAudioObject[key] === "number")
   {
       console.log(key);
   }
}</code></pre>
</div>
</div>
</p>