[core][js] update custom string functions for JavaScript