Skip to content
Advertisement

Replacing part of string with prefix and suffix

JavaScript

I want to make it

JavaScript

Texts to replace with is with in braces () or [] and can be found from Table 1 or Table 2.

JavaScript

Current approach

JavaScript

How to improve the code to skip not-required loop ?

Advertisement

Answer

There may be a way with one loop that I’ll think on, but since the arrays have the same keys they can’t be merged:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement