-1

I heard it in a podcast, that, there is a function which takes two args, and returns one of them, and it doesn't tell you which one.

What's the name of this function?

That podcast is about functional reactive programming, and the host itself created a modified version of such a function, so that it can be predicted that which arg will be returned.

Not an ID
  • 2,419
  • 1
  • 16
  • 25

1 Answers1

0
function random(a,b){
    var list = [a,b];
    var random_01 = Math.floor(Math.random()*2);
    return list[random_01];
}

This is my solution in JavaSript. I do not know the name of that function, but it could be named like Binary option..

mryuso92
  • 207
  • 1
  • 19
  • 1
    I am asking for that specific function's name, not an implementation. Thanks anyway. – Not an ID Sep 01 '15 at 11:28
  • Sounds like Schrödinger parameters, the function can take the first or the second parameter... Anyway, you can hear again that podcast or write an email to the podcasters. – mryuso92 Sep 01 '15 at 11:35