Collin  Rippin

Collin Rippin

1619436360

Alan Turing Proved Why All Programmers Should Be Writing Tests

Can you write a JavaScript function that receives an arbitrary function and an input as arguments and returns true if this function finishes executing (halts) after called and false if it doesn’t, for every possible combination of function and input?

For the sake of the exercise, assume no time or memory limit is binding our JS Engine and that the engine itself works flawlessly.

What we’re looking for is something like this:

#javascript

Alan Turing Proved Why All Programmers Should Be Writing Tests