Javascript sanity