偶尔你会遇到这种情况,一个代码库希望传入number或string类型的参数。例如下面的函数:/** * Takes a string and adds "padding" to the left. * If 'padding' is a string, then 'padding' is appended to the left side. * If 'padding' is a number, then that number of spaces is added to the left side.