Wondering if this is possible and if so , how ?
var variable = true;
if (variable) {
var newVariable = "$('table').find('tr').length > 1)";
} else {
var newVariable = "$('table').find('tr').length > 4)";
}
if (newVariable){ // if $('table').find('tr').length > 1)
console.log(newVariable)
}
I would like the if to look like this by inserting using the newVariable when variable is true
if ($('table').find('tr').length > 1)){
console.log(newVariable)
}
of if variable is false then this
if ($('table').find('tr').length > 4)){
console.log(newVariable)
}