js Array对象的扩展函数代码

wujiaojiao72951 19 0 PDF 2020-12-02 22:12:58

使用 代码如下:[removed]var isNumeric = function(x) { // returns true if x is numeric and false if it is not. var RegExp = /^(-)?(\d*)(\.?)(\d*)$/; return String(x).match(RegExp);}var myArray = [1,’two’,3,’four’,5,’six’,7,’eight’,9,’ten’];var oddArray=myArray.filter(isNumeric);

用户评论
请输入评论内容
评分:
暂无评论