Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wouldn't a static parse method still allocate memory for the object that it returns?


> Wouldn't a static parse method still allocate memory for the object that it returns?

Yes, but you don't have the overhead of constructing URL first. The new URL.canParse method from the article covers this.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: