I have below code in my function, I want to assign a value to the variable newValue.
var newValue = fieldValue || originalValue || masterValue;
Yes but it gets a bit complicated (using the ternary operator).
var newValue = fieldValue || (originalValue || originalValue===0) ? originalValue : masterValue;
(this assumes you want to 0 to be assigned even when in