Consider the following sentences:
It is a recursive function. It is initially called on the root node of the DOM tree (body element).
To combine them I thought to say
It is a recursive function and is initially called on the root node of the DOM tree (body element).
To refine it I thought to say:
It is a recursive function which is initially called on the root node of the DOM tree (body element).
But I doubt the last sentence is grammatical. Can "which" be used to relate such sentences? Because it doesn't distinguish something from other similar things. It is just one function.
Other examples:
He is a boy. He goes to school every day.
Can I say :
He is a boy who goes to school every day!