The code below runs without an error, but its result is wrong. Which statement correctly identifies the bug?
const latest = "10.2";
const installed = "9.8";
console.log(latest > installed ? "Update available" : "Up to date");
String comparison looks only at the first differing character. Split and compare numerically: const [a, b] = latest.split(".").map(Number); … (or localeCompare with { numeric: true }).