showButton(button, {playing});
manageAudio(player, {playing});
Well done. I should be back in about eight hours time to help further with things.
function playButton(button) {
var player = getAudio();
var playing = isPlaying(button);
showButton(button, {
playing
});
manageAudio(player, {
playing
});
SyntaxError: expected expression, got ā)ā
}());
button.addEventListener("click", initialOverlayClickHandler);
});
}());
Redefinition of ābuttonā from line 110.
var button = getButtonContainer(evt.target);
138.20
Redefinition of ābuttonā from line 110.
var button = getButtonContainer(evt.target);
143.20
Redefinition of ābuttonā from line 110.
var button = getButtonContainer(evt.target);
148.20
Redefinition of ābuttonā from line 110.
var button = getButtonContainer(evt.target);
160.9
Unexpected ā(ā.
}());
The playButton() function still has trouble. You have correctly closed off the calls to showButton() function and the manageAudio() function, but you havenāt yet closed off the playButton() function itself, yet.
function playButton(button) {
var player = getAudio();
var playing = isPlaying(button);
showButton(button, {
playing
});
manageAudio(player, {
playing
});
}
}
SyntaxError: missing ) in parenthetical
function showPause(button) {
function showPause(button) {
if (isPlaying(button)) {
showPauseButton(button);
}
}
You have now closed off the playButton() function, which is good, but you have also closed off the IIFE statement, resulting in the rest of the code below it being invalid.
Open
(function iife() {
"use strict";
Close
});
}());
How do I fix it?
No, not quite.
The IIFE is opened with:
(function iife() {
Which has the opening curly brace, that must have a closing curly brace, and it also has an opening parenthesis. The opening parenthesis is a wrapper turns the function declaration which cannot normally be invoked, into a function expression which can be invoked, but thatās aside from the issue at hand.
The above code has a (
and a {
that must be accounted for.
The end of the IIFE is:
}());
Where the closing curly brace ends the function expression, the ()
invokes that function expression causing the code to immediately run, and the )
ends the wrapper.
You placed two closing curly braces below the playButton() function, which was one too many.
SyntaxError: missing ) in parenthetical
function showPause(button) {
function showPause(button) {
if (isPlaying(button)) {
showPauseButton(button);
}
}
Thatās right, because you still have done nothing about my previous post.
I deleted this:
});
from:
button.addEventListener("click", initialOverlayClickHandler);
}());
Well that was wrong and a big mistake. Put it back.
ok:
now what?
});
());
Now this.