The two ''this'' appear in red


#1

I am reviewing over and over but can't find the problem.

var main = function() {
    $('.article').click(function() {    
    $('.article').removeClass('current');
     $('.description').hide();
     
     $(this).addClass('current');
     $(this).children('description').show();
     
    });
    
};

$(document).ready(main);

Thanks in advance! :smile:


#4

Hi Jor91,

The red this-s are OK. It's just syntax highlighting, which makes code easier to read. For example, try finding the error here:

var myName = "Zeke Y';

var foo = function(bar, baz) {
  return bar + " : " + baz;
}

foo(2, 1);

It's not nearly as easy as with syntax highlighting, where you can see there's an unclosed quote on line 1 pretty easily:

var myName = "Zeke Y';

var foo = function(bar, baz) {
  return bar + " : " + baz;
}

foo(2, 1);

As you program more, you'll find syntax highlighting to be more and more useful :)