nextDot not working correctly?


I'm working on how to make an interactive website, I'm on 7/12, and I had to make the dots below a carousel, but the if statement isn't working the way it should?

Here's my code:

var main = function() {
// Toggles dropdown menu.
$('.dropdown-toggle').click(function() {
// "Next Arrow" function
$('.arrow-next').click(function() {
var currentSlide = $('.active-slide');
var nextSlide =;

// Animated Carousel
if (nextSlide.length === 0) {
nextSlide = $('.slide').first();
nextDot = $('.dot').first();


// Animated dots for the carousel.
var currentDot = $('.active-dot');
var nextDot =;




Hi Dane,

You can't work with a variable before defining it. These two lines:

belong above the if statement checking if nextSlide.length === 0.


Yeah I noticed that a few minutes ago, but now I'm having problems with the next step lol. I'll make a new post though.