2021年1月25日星期一

Storing all the array values into single variable and then using that value as css property through javascript

Suppose i have this array,

let array = [];    for (let i = 1; i < 101; i++) {    const element = `${i}px ${i}px #0e96ff`;    array.push(element);  }  

now is it possible to store all the 100 values into single variable and then use that value as a css property like this:

let variable = array;    //css property  let style = { filter:`drop-shadow${vairable}`}  

if no then how can i achieve the same result?

thanks in advance.

https://stackoverflow.com/questions/65895757/storing-all-the-array-values-into-single-variable-and-then-using-that-value-as-c January 26, 2021 at 12:06PM

没有评论:

发表评论