What you're talking about is a ternary operator, which is a string conditional statement. To illustrate:
this.year = (isNaN(year) || year == null) ? calCurrent.getFullYear() : year;
equivalently
if(isNaN(year) || year == null){
this.year=calCurrent.getFullYear()
}
else{
this.year=year;
}
source
share