What did I do wrong?
function playButton(button) {
var player = getAudio();
var playing = isPlaying(button);
showButton(button, playing);
manageAudio(opts.playing, {
playing
}
What did I do wrong?
function playButton(button) {
var player = getAudio();
var playing = isPlaying(button);
showButton(button, playing);
manageAudio(opts.playing, {
playing
}
What does the browser console tell you about it?
SyntaxError: missing ) after argument list
So a closing parenthesis is missing.
function playButton(button) {
var player = getAudio();
var playing = isPlaying(button);
showButton(button, playing);
manageAudio(opts.playing) {
playing
}
Looking at the code, you have closed the object that youâre giving to the manageAudio function, but whereâs the closing parenthesis thatâs supposed to close the argument list that youâre giving to the function?
You havenât closed the function either.
What happens with playing?
function playButton(button) {
var player = getAudio();
var playing = isPlaying(button);
showButton(button, playing);
manageAudio(opts.playing) {
playing
}
playing();
You place the closing parenthesis in the wrong place, it needs to be after the object that playing is inside of.
I donât understand
manageAudio(opts.playing) {
playing
}
}
You placed the closing parenthesis in the wrong place, putting it well before where it must be.
Itâs still not working.
manageAudio(opts.playing, {
playing
});
As I was saying earlier, your function hasnât been closed either.
Open closed
{}
{
playing
}
I donât understand, and I still donât understand.
All functions declarations have the following structure:
function someName(parameters) {
// ...
}
The closing curly brace that ends the function, seems to be missing from your code.
function playButton(button) {
var player = getAudio();
var playing = isPlaying(button);
showButton(button, playing);
manageAudio(opts.playing, {
playing
});
}
}
}
Use the Tidy button, and youâll see if you have too many or too few.
I donât understand how many Iâm supposed to have, and what they should look like.