How does JS retain the number and maximize the number of Filter text?

1 drop the following array Filter Chinese characters and retain the number
2 for circular Filter assignment to C
3 for the maximum value

data Code:

var arr_db = [
            ["",400],
            ["",375],
            ["",377],
            ["",322]
        ];

Filter text, extract text:

 function num(arr){
               var ayy = [];
               for (var i=0;i<arr.length;iPP) {
                    ayy +=parseInt(arr[i][1])+",";
            }
               return ayy;
       };
   var wanju  = num(arr_db);   

the number extracted is: 400375377322
find the maximum:

document.write(Math.max.apply(null,wanju));

Why is the output NaN?

Mar.13,2021

for (var i=0;i<arr.length;iPP) {
      ayy.push(arr[i][1]);
}

Filter text, extract text: (need to be converted to an array first)

let arr_db = [["", 400],["", 375],["", 377],["", 322]];
let str = arr_db.join(',').split(',')
let num = str.filter( item => { return /^\d+$/gim.test(item) } )
console.log(Math.max.apply(null, num))
Menu