Summing the first 1 to n powers of 2
EVAL, WHY!?

I really can't understand why you're using String concatenation and eval to calculate the result.

The most efficient way is to calculate \$2^{n+1}-2\$.

Additionally, your variable names are all one character long, and your code lacks spacing.

How can you tell what is t and what is q? Your variable names make no sense.

function solution (n) {
    var result = 2;
    for (var i = 1; i &lt;= n; i++) {
        result *= 2;
    }
    return result - 2;
}


Another solution is to use bit shifting: (only works if \$n &lt;= 29\$)

function solution(n) {
    return (2 &lt;&lt; n) - 2;
}