DEV Community

loading...

Discussion on: PHP 8 features I wish also existed in JavaScript

Collapse
ogrotten profile image
ogrotten • Edited

darn near anything is allowable as an object key. Besides that, that's a high corner case.

const x = {
["\$&n"]: 12
}

x["\$&n"]
12

I tried to paste this here in a code block, but it wouldn't show.