In Javascript, closures both have identity and are mutable, which is a huge pain when using React.
Coming from a ClojureScript background, it pains me to have to deal with all the idioms in React that hack around this fundamental impedance mismatch by forcing users to carefully maintain reference equality for collections between renders for perf optimizations, and more recently for correctness in hooks like useEffect.
But comparing modern Javascript to ancient PHP would be even more unreasonable.