This code
var i = '[0]'; i.replace(/\[|\]/, ''); returns i = '0]'
I want to use .replace function to converti = '0';
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalThis code
var i = '[0]'; i.replace(/\[|\]/, ''); returns i = '0]'
I want to use .replace function to converti = '0';
gflag./\[|\]/, which is[. I generally won’t post answers without searching for duplicate targets first.