Ok after @maxgy and @factoradic. I'll give it another try to order this a little:
So let's go through the code step by step:
you start of with a being set to false. Problem here: a is never used again. Sure you use a as the parameter of your function, but a parameter is a local variable of a function so although they share the same name these to variables are in no way connected with each other.
Then you declare a variable condition and assign a function to it and after this you call the function by using:
by using false as the argument, you assign the value of false to the parameter a of your function. So because of this line the value of a inside of your function is false, again that has nothing to do with the
var a = false statement that just so happens to have the same name and value (pure coincidence no dependence on each other).
Unfortunately you never use this value as well. So what happens next is that you go into your do/while loop, starting with the console.log part and then the condition is checked:
So what is that condition named condition?
Well the variable condition contains your function and as functions do not occur on the list of falsy values:
they are truthy, meaning that the value in condition is interpreted to being true, meaning you're trapped in an infinite loop.
Hope this makes it easier to understand the other 2 explanations.