kaka kaka - 4 years ago 86
Javascript Question

What is ? in JQUERY

I have the following code and I am trying to understand it:

labels: {
formatter: function () {
return (this.value > 0 ? ' + ' : '') + this.value + '%';
}
},


But I don't understand what does
?
means? Could anyone explain me? I would appreciate it.

Answer Source

The converted if else statement would be:

if(this.value>0)
    return '+' + this.value + '%';
else
    return '' + this.value + '%';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download