search

Home  >  Q&A  >  body text

javascript - When js binds default values ​​to parameters, an error is reported under IE, showing that the identifier is missing)

The code can run normally in Firefox and Google. It will report an error under IE.
The errors are all in the two function definitions.
The functions are as follows:

If =null and =true are removed here, it will run normally under IE.
iedeg The error message is SCRIPT1006: Missing ')'
I don't know why. People on Baidu said that there are extra commas in the array. .But I checked everything and there is no problem with what I wrote.
I also used jq and layui. I used regular expression to detect the extra commas in the array and found no extra commas. I feel it has nothing to do with the commas.
The problem lies in these two On the equal number, as long as it is removed, it can be used normally.
I hope God can enlighten me.

世界只因有你世界只因有你2750 days ago1010

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-19 10:38:03

    You use ES6 syntax to run on IE. Have you compiled it with babel?

    Change it to ES5 writing:
    function bf_append_status(name,live){

    var live=live||true;

    }

    Same as above.

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-19 10:38:03

    Default parameter values

    IE does not support it.

    reply
    0
  • Cancelreply