This doesn't guarantee that the result is a valid identifier – `name` could be a reserved word or the empty string, for instance.

It also unnecessarily mangles `$` :)