【问题标题】:Object doesn't support property or method 'startsWith' [duplicate]对象不支持属性或方法'startsWith' [重复]
【发布时间】:2018-04-04 20:11:59
【问题描述】:

在我的 webpack 中:

{
  "presets": [
    ["env", {
      "targets": {
        "browsers": [">0.1%", "last 4 versions", "not ie <= 9"]
      }
    }]
  ]
}

但我在 IE 中出现错误:

对象不支持属性或方法'startsWith'

【问题讨论】:

    标签: javascript reactjs internet-explorer webpack


    【解决方案1】:

    startsWith 是 String 的一个方法,'hello there'.startsWith('hello') === true。任何版本的 IE 都不支持,但你可以polyfill itpolyfill.io 非常擅长零努力地捕捉大量此类内容。

    【讨论】:

      猜你喜欢
      • 2017-09-01
      • 1970-01-01
      • 2018-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-23
      • 2014-07-29
      • 2019-07-05
      相关资源
      最近更新 更多