how to fix Javascript unexpected token illegal

不羁的心 提交于 2019-12-25 02:13:42

问题


I am getting an error in the following code on the first line:

if (typeof module != ‘undefined’ && module.exports) {
  module.exports = PushNotification;
}

This is the error:

I cannot seem to find the syntax error here. I am trying to use PushPlugin for iOS.


回答1:


It looks like you copy-pasted out of a rich text document and it inserted smart quotes:

‘undefined’

Replace them with regular quotes:

'undefined'


来源:https://stackoverflow.com/questions/22237301/how-to-fix-javascript-unexpected-token-illegal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!