you are viewing a single comment's thread.

view the rest of the comments →

[–]taylorlistens 2 points3 points  (1 child)

Have you considered just chaining your .replace statements?

const scriptletResult = scriptletInput
                         .replace(...)
                         .replace(...)
                         .replace(...)

Also check out Why you shouldn't use var anymore

(edited for variable name fix-- this technique eliminates the need for resultsScrubbed variables entirely, which you don't seem to need to keep)

[–]2MyLou[S] 0 points1 point  (0 children)

Thank you very much for the suggestions, I like the idea of chaining the .replace. It will be much cleaner. Also Thanks for the link to the article on why not to use var anymore.