题解 | #判断版本#
判断版本
https://www.nowcoder.com/practice/dcc4b011c86c454aa58cb1790a8cb760
const _shouldUpdate = (oldVersion, newVersion) => { // 补全代码 let oldV = oldVersion.toString().split('.'); let newV = newVersion.toString().split('.'); for (let i = 0; i < 3; i++) { if (newV[i] > oldV[i]) { return true } } return false; }