\u200b (Zero width space) characters in my JS code. Where did they come from?

前端 未结 5 646
失恋的感觉
失恋的感觉 2020-11-27 04:05

I am developing a front end of a web app using NetBeans IDE 7.0.1. Recently I had a very nasty bug, which I finally fixed.

Say I have code

var elemen         


        
5条回答
  •  情书的邮戳
    2020-11-27 04:47

    This happened to me when I copied source code from another site into my editor. If your using visual studio code or Atom editor, this will highlight those pesky characters zero-width space \u200b) etc.

    • VSCode: https://marketplace.visualstudio.com/items?itemName=nhoizey.gremlins
    • Atom editor: https://atom.io/packages/highlight-bad-chars
    • Sublime Text: https://packagecontrol.io/packages/Gremlins

提交回复
热议问题