printf-like formatting for JavaScript