#10 Variables not defined?


#1

I'm having trouble with my coding, and it looks 100% correct to me, I'm not sure why it won't work, I've checked it so many times and read the instructions loads, still can't workout what is wrong with it.

Here is my coding:

var main = function() {
$('.dropdown-toggle').click(function() {
$('.dropdown-menu').toggle();
});

$('.arrow-next').click(function() {
var currentSlide = $('active-slide');
var nextSlide = currentSlide.next();

var currrentDot = $('active-dot');
var nextDot = currentDot.next();

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

currentSlide.fadeOut(600).removeClass('active-slide');
prevSlide.fadeIn(600).addClass('active-slide');

currentDot.removeClass('active-dot');
nextDot.removeClass('active-dot');
});

$('.arrow-prev').click(function() {
var currentSlide = $('.active-slide');
var prevSlide = currentSlide.prev();

var currentSlide = $('.active-dot');
var prevDot = currentSlide.prev();

if(prevSlide.length == 0) {
prevSlide = $('.slide').last();
}

currentSlide.fadeOut(600).removeClass('active-slide');
prevSlide.fadeIn(600).addClass('active-slide');

currentDot.removeClass('active-dot');
prevDot.addClass('active-dot');
});

};

$(document).ready(main);


#2

Okay never mind, I just found the problem, the hint on the side is wrong, the lone } under: f(prevSlide.length === 0) { prevSlide = $('.slide').last(); - is meant to be a: });