在使用split() ; 方法之前,需要先进行判断
如下实例:
//
var str = input ? input.split(',') : [];
// 或者
if(!input){
var str = input.split(',');
}
//
if(input != undefined){
var str = input.split(',');
}
如下使用方式错误:
var str = input.split(',');
在使用split() ; 方法之前,需要先进行判断
如下实例:
//
var str = input ? input.split(',') : [];
// 或者
if(!input){
var str = input.split(',');
}
//
if(input != undefined){
var str = input.split(',');
}
如下使用方式错误:
var str = input.split(',');
本文标题:TypeError: Can not read property
本文链接:https://www.haomeiwen.com/subject/yefuvqtx.html
网友评论