Skip to content

Instantly share code, notes, and snippets.

@sidvishnoi
Last active December 17, 2019 13:48
Show Gist options
  • Save sidvishnoi/066d33b996c775b85add361392b2265d to your computer and use it in GitHub Desktop.
Save sidvishnoi/066d33b996c775b85add361392b2265d to your computer and use it in GitHub Desktop.
​console.log("hey");
// There is a space before the first line, which is not renderered by many
// IDEs/text editors.
//
// It bit me once when I copied a snippet from some site, and they added
// (probably accidentally; evil otherwise) a zero-width space before every line
// of code. The code failed to compile saying "unexpected token", but it took me
// quite some time to understand what just happened.
@sidvishnoi
Copy link
Author

You can run above as:

node -e "$(curl -s https://gistcdn.githack.com/sidvishnoi/066d33b996c775b85add361392b2265d/raw/bd708caa98060e8ca32fac77df9386acdd024182/zero-width-space.js)"

I promise I didn't add any zero-width space in above snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment