What is the use of || operator in assignment in JavaScript?
|| operator is used to assign the value if there is no value assigned to it.
Example :-
var vr1 ;
var vr2=vr1 || ‘some value’;
Explanation:-
In above example if vr1 is not value then ‘some value' string value will be assigned to vr2.