Debugging utility functions for JavaScript