.match()
不会给出一个带有元素的数组吗?
相反,它只是一个字符串?
var descr = jobs[i].description;
console.log(typeof descr);
descr.match(/\b(java|python|javascript|ruby|rails)\b/i);
答案 0 :(得分:0)
好吧我搞定了
var descr = jobs[i].description;
var arr = descr.match(/\b(java|python|javascript|ruby|rails)\b/gi);
if(arr !== null){
console.log("arr is? " + typeof arr); //<--- will print "object" i dont know why?
console.log("arr " + arr);
console.log("arr [0] " + arr[0]);
console.log("arr ..." + arr.length);
}