I am sorry but Javascript is not much better than XSLT. Horrible legacy technology full of bugs nobody was bothered to fix.
Whether you should be using it for the problem XSLT tries to solve is another question. Probably not, since there are other templating languages.