RegExp
これは怒られる。 new RegExp('{0}'); これはOK const regex = new RegExp(`\\{0\\}`, 'g'); const replaced = 'BAR{0}HOGE{0}FUGA'.replace(regex, '置き換えた');
これは怒られる。 new RegExp('{0}'); これはOK const regex = new RegExp(`\\{0\\}`, 'g'); const replaced = 'BAR{0}HOGE{0}FUGA'.replace(regex, '置き換えた');