Why does the logical or operator (||) with an empty arrow function (()=>{}) cause a SyntaxError?

后端 未结 3 712
长情又很酷
长情又很酷 2020-11-28 16:14

In my code, I have something that boils down to this:

var x = y || ()=>{};

(In case you are wondering, I am later calling x()

3条回答
提交回复
热议问题