Javascript var in string

后端 未结 3 1211
日久生厌
日久生厌 2021-01-25 01:49

So I have this code and would like to know how I could go ahead to put my javascript var into this string. I cannot seem to make a working code for myself.

For the image

3条回答
  •  孤街浪徒
    2021-01-25 02:29

    Try using ES6 new feature called Template literals (using quote). It is more cleaner and simpler.

    var picture = {'value':'test-src-location'};
    var text = ``;
    console.log(text);

提交回复
热议问题