I need to use this logical operator: ⇒ which will be inserted in a string like this:
var mystring = "(true ⇒ false) ⇒ true";
That way I should be able to evaluate that expression with eval(mystring)
and return the truth value to me.
But JavaScript does not support it, is there any way to create it? It has certain very basic rules, it can even be simulated with this function that receives two Boolean variables:
function Condicional(v1,v2){
return (!v1)||v2; //formula de una condicional
}
but that function can not be applied to any other type of operation in which you use ⇒, or at least it has not occurred to me how.
Maybe there is a place where I can define that logical operator for JavaScript to recognize me, I do not know, maybe in the same place where others are defined as the "!", "& & amp; "," || "," === "...
Is it possible?
edit
I need to know if there is a way to create an operator like this: ⇒ but I will also need to create two more operators, so what I'm looking for is how to create any operator other than what javascript already has.