Puzzle 7How Long Is a Pirate Flag?
 // Happy Flag Day!
images/pirate_flag_puzzle.png

Guess the Output

images/aside-icons/important.png

Try to guess what the output is before moving to the next page.

images/hline.png

You might have anticipated that the output would be 1, but this code will actually output:

 4
images/hline.png

Discussion

The length of emojis may not be what you expect. In JavaScript, some characters ...

Get JavaScript Brain Teasers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.