题解 | #判断版本#
判断版本
https://www.nowcoder.com/practice/dcc4b011c86c454aa58cb1790a8cb760
const _shouldUpdate = (oldVersion, newVersion) => { let oldStr=oldVersion.split('.').join(''); let newStr=newVersion.split('.').join(''); oldStr=parseInt(oldStr); newStr=parseInt(newStr); let flag=newStr>oldStr?true:false; return flag; } _shouldUpdate('9.8.9','10.8.9')