0

I have the following code, can anyone please tell me what "!!" is here. Thank you.

$('#calendar').fullCalendar({
    events: function(start, end, timezone, callback) {
        jQuery.ajax({
            url: 'schedule.php/load',
            type: 'POST',
            dataType: 'json',
            data: {
                start: start.format(),
                end: end.format()
            },
            success: function(doc) {
                var events = [];
                if(!!doc.result){
                    $.map( doc.result, function( r ) {
                        events.push({
                            id: r.id,
                            title: r.title,
                            start: r.date_start,
                            end: r.date_end
                        });
                    });
                }
                callback(events);
            }
        });
    }
});

I did some Google search, unfortunately I could not find such operator. If you know any web site as reference, please let me know.

Thanks.

p.p
  • 51
  • 5

1 Answers1

1

It is double negation, used to explicitely convert the value to a boolean.

Pavel Gatnar
  • 3,829
  • 2
  • 17
  • 29
  • Got it. So it casts an object to a Boolean value and then negate the Boolean value back. Thanks a lot. – p.p Sep 16 '15 at 20:30