📌  相关文章
📜  为什么我无法读取未定义的属性 'toString' 或 'toUpperCase' - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:18.107000             🧑  作者: Mango

代码示例1
//To make sure that .toString() or .toUpperCase() doesn't throw an error,
you could:

string = "" + string; // amends the value to an string, even if its undefined or null etc
//instead of:
string = string.toString();