i have got this code:
function isTruthy(value) {
switch (value) {
case false:
return false;
case null:
return null;
case undefined:
return undefined;
case 0:
return 0;
}
return value
}
const nextValue = isTruthy(xsd[nextPath]) || isTruthy(xsd`xd:${[nextPath]}`) ;
if the first part isTruthy(xsd[nextPath])
is 0 but the second part isTruthy(xsd`xd${[nextPath]}`)
is undefined then the nextValue value will be undefined, but i would like if it would be 0, how can i do that ?