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

I recently found out that the Function object will compile any javascript you care to feed to it. At runtime! new Function('class MyClass { ...}; return MyClass') My system does not allow for "imports". No npm etc. So this is a bit of a lifesaver for me. I realize in js land it may not be as useful but it is pretty handy.


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

Search: