Skip to content

Commit

Permalink
add behavior JS
Browse files Browse the repository at this point in the history
  • Loading branch information
xanhacks committed Sep 8, 2023
1 parent 9c7e7b5 commit 4d145f0
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions content/en/docs/programming/javascript/behavior.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "Strange behavior"
description: "Strange behavior of Javascript"
lead: "Strange behavior of Javascript"
date: 2023-01-01T00:00:00+00:00
lastmod: 2023-01-01T00:00:00+00:00
draft: false
images: []
menu:
docs:
parent: "javascript"
weight: 620
toc: true
---

## Uppercase

Certain Unicode characters, when uppercased, actually expand in length.

```js
for (let i = 0; i < 0x10FFFF; i++) {
var c = String.fromCodePoint(i);
var upper = c.toUpperCase();
if (c.length !== upper.length)
console.log(i, c, c.length, upper, upper.length);
}
```

```
223 ß 1 SS 2
329 ʼn 1 ʼN 2
496 ǰ 1 J̌ 2
912 ΐ 1 Ϊ́ 3
944 ΰ 1 Ϋ́ 3
1415 և 1 ԵՒ 2
7830 ẖ 1 H̱ 2
7831 ẗ 1 T̈ 2
...
```

0 comments on commit 4d145f0

Please sign in to comment.