React中字符串连接变量名形成新字符串

const x = 'xxxxx';

方法1:

          const y = `string sample ${x}`;

方法2:

          const z = {"name"+x+"age" };

猜你喜欢

转载自blog.csdn.net/qq_26670901/article/details/82049568