某函数返回一个对象,如果在最后一个属性后加逗号,IE7及以下版本中会报错

正确代码:

return{
top:rect.top-top,
bottom:rect.bottom-top,
left:rect.left-left,
right:rect.right-left
}

错误代码(IE8以上都不会报错)

return{
top:rect.top-top,
bottom:rect.bottom-top,
left:rect.left-left,
right:rect.right-left,
}

  

相关文章:

  • 2022-03-02
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案