# 两值对比

function gt(value, other) {
  if (!(typeof value === 'string' && typeof other === 'string')) {
    value = +value;
    other = +other;
  }
  return value > other;
}

如果不为字符串,则转换成数字进行比较,否则逐位比较。

最近更新时间: 2020/9/6 11:30:38