How to use wp_localize_script() variable in js as a variable? (not as string)

Solution:

Alright. Finally I’ve found the function by myself. It’s eval().

The eval() function is able to evaluate or executes an argument that is passed inside it. If the argument is an expression, this function will evaluate the expression and the argument is one or more JavaScript statements, eval() executes the statements.

Quote fromĀ https://www.codespeedy.com/convert-string-into-variable-name-in-javascript/

var colorVariation = '_red';
var btnVariation = '_male';        
var order = script_vars.order;

var varId = '.variation' + eval(order);