i have question about getting character of string after space where the string is value of array like this..
arr = ['aaa: 2' , 'aaa: 5', 'aaa: 6', 3 , 7 , 8];
output = arr.filter(function (p) {
if (!Number(p)) { // get string value
return p.includes('aaa').split(' ').pop();
}
});
console.log(output)
i got error "TypeError: p.includes(...).split is not a function"
if i remove the .split(' ').pop();
array['aaa: 2','aaa: 5','aaa: 6']
i just want the output like this
array [2,5,6]
can anyone who's have experience on same problem help me? i'm stuck. thank you guys...