What does this expression return?
['๐'.match(/./g).length, '๐'.match(/./gu).length]
- [2, 1]
- [1, 1]
- [2, 2]
- [1, 2]
Without
Play Regex โธ
u the regex works on UTF-16 code units, so the emoji counts as two surrogate halves.