In simple words, what is the ?:
(conditional, "ternary") operator and how can I use it?
If you have one condition check instance function in javascript. it's easy to use ternary operator. which will only need one single line to implement. Ex:
private module : string ='';
private page:boolean = false;
async mounted(){
if(this.module=== 'Main')
{
this.page = true;}
else{
this.page = false;
}
}
a function like this with one condition can be written as follow.
this.page = this.module=== 'Main' ?true:false;
condition ? if True : if False