How to dynamically set a function/object name in Javascript as it is displayed in Chrome

Object.defineProperty(fn, "name", { value: "New Name" });

Will do the trick and is the most performant solution. No eval either.

Leave a Comment