
In plain JavaScript, how do you build an instance of the Audio constructor?
new Audio();
New Audio();
Audio();
If an object instance of the Audio constructor is saved in a variable named “song”, what property on the “song” object can you use to check if the song is currently playing?
song.paused
song.pause();
song.play()
What is wrong with this code?
function toggle() { if(song.paused) { song.pause() } else { song.play() } }The app's logic doesn't work. The code on line 3 and the code on line 5 should swap places.
The condition in the if statement is wrong. It should be:
if(song.paused())
You need to have an else if condition, in between the if and else conditions.
About the author
A passionate full-stack developer from @ePlus.DEV
Comments
Join the discussionNo comments yet. Be the first to comment.
React Basics
In this module you will explore the basic structure and use of the React.js library. You will learn how to produce single page web applications using React components and to use JSX to style them.






