use typeof rather than instanceof
Provide default value for children
Throw if required parameters were not supplied