0
There is this following code and I’m very confused about it, even fiddling with javascript, I tried debugging but I put a console.log inside the function in the variable "T" and it printa truth, false... but no parameter is passed to this T, in reality it happens in reverse pass the T within the AND, at last I am quite confused about it. I just need to understand why to perform from the display to the AND etc...
var T = function (a, b) {
console.log(a,b);
return a;
};
var F = function (a, b) {
return b;
};
var display = function (b) {
//console.log(b);
return b('verdadeiro', 'falso');
};
var NOT = function (x) {
return x(F, T);
};
var AND = function (a, b) {
return a(b, F);
};
var OR = function (a, b) {
return a(t, B);
};
// agora testando:
alert(display(AND(T, T))); // Vai exibir Verdadeiro, como deveria.
but T takes 2 parameters and when it returns Return a(b, F); Both F and b(which in this case is another T) receive 2 parameters, and only call them there
– Andyh Henrike
I put a supplement in the answer, see if it clarifies you.
– bfavaretto
Ah ta I understand now, thank you very much
– Andyh Henrike