JSFiddle - React, Tailwind, and code Playground
JavaScript
function f1() {
return {
from: 0.5,
to: null
};
}
function f2(m) {
var width;
if (m.to === null) {
width = '';
} else {
width = m.to - m.from;
}
return {
width: width
};
}
var i = 50000,
count = 0;
console.log('start');
while (i--) {
var m = f1();
var x = f2(m);
if (x.width) {
if (!count) console.log(m.to, '->', x.width);
count++;
}
}
console.log(count, 'times evaluated null as 0');