Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is ≤ a legit less than equals char?

I was reading the release notes of Visual Studio Code and a particular caught my eye.

Screenshot from the release notes

As you can see, there is a javascript file with the ≤ symbol. I can't figure out how it works, if I try to use it in my code I get a "Invalid or unexpected token" error (which I was expecting), and I can't find if it's only a VSCode configuration that shrinks <= into ≤ for aesthetic purposes.

How does it work?

like image 425
bimbo1989 Avatar asked Apr 13 '18 08:04

bimbo1989


Video Answer


2 Answers

It looks like a monospaced font with ligatures, which makes <= looking as one sign.

Some sources:

  • https://github.com/tonsky/FiraCode
  • https://github.com/i-tu/Hasklig
  • https://github.com/be5invis/Iosevka
like image 101
Nina Scholz Avatar answered Sep 25 '22 20:09

Nina Scholz


This is just due to the font ligature. The actual characters are 2: <= but the ligature renders them as one.

Some fonts support ligatures such as Fira Code and most likely you need to enable ligatures on your IDE if you want to use them.

like image 33
xyzale Avatar answered Sep 23 '22 20:09

xyzale