📜  js 在位置插入字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:18.452000             🧑  作者: Mango

代码示例1
var a = "I want apple";
var b = " an";
var position = 6;
var output = [a.slice(0, position), b, a.slice(position)].join('');
console.log(output);