vendredi 4 novembre 2016

Javascript: If variable mets a condittion defined on another variable

My problem is simple but I can't find a way to make thag work

The idea is that if a variable (number) mets a condittion defined on another variable (cond), run some code

Example:

var cond = '> 4';
var number = 5;
// Some type of if statement to check if 5 is > 4 

Aucun commentaire:

Enregistrer un commentaire