Though your question is not too clear but i think i got it. We can only pass a variable in a string by using back ticks not quotes;
const tabToActivate = container.querySelector(`.tabcontent[data-tab="${currentTab}"]`);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…