实现函数使得将str字符串中的{}内的变量替换,如果属性不存在保持原样(比如{a.d})
复制1var a = { 2 b: 123, 3 c: '456', 4 e: '789', 5} 6var str=`a{a.b}aa{a.c}aa {a.d}aaaa`; 7// => 'a123aa456aa {a.d}aaaa'
1var a = { 2 b: 123, 3 c: '456', 4 e: '789', 5} 6var str=`a{a.b}aa{a.c}aa {a.d}aaaa`; 7// => 'a123aa456aa {a.d}aaaa'
题库维护不易,您的支持就是我们最大的动力!