Last active
July 6, 2023 19:15
-
-
Save pesterhazy/82a4166e1f5a8dd1689f5f1f99eae79c to your computer and use it in GitHub Desktop.
JS Headers iteration wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headers = new Headers([["a","A"],["b","B"]]); | |
headers.forEach((_,k) => headers.delete(k)); | |
console.log([...headers].length); | |
// expected: 0 | |
// actual: 1 (Chrome 114) | |
// actual: 1 (Bun.js v0.6.13) | |
// actual: 1 (Safari 16.4) | |
// actual: 0 (Node v18.12.1) |
// actual: 1 (Node v18.14.2)
See this test case in Web Platform Test (WPT) web-platform-tests/wpt@a31d3ba
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work as expected:
This does: