$ ./guess_the_languageRegex
Regex ยท hard ยท #39

What does this expression return?

['๐Ÿ˜€'.match(/./g).length, '๐Ÿ˜€'.match(/./gu).length]
  1. [2, 1]
  2. [1, 1]
  3. [2, 2]
  4. [1, 2]
Without u the regex works on UTF-16 code units, so the emoji counts as two surrogate halves.
Play Regex โ–ธ