Please login to start chat

ICT Solutions 11 Jun 2022, 09:56:23
Category : JavaScript Tutorials

filter (JavaScript Array Method)

const tnwAges = [25, 18, 29, 20, 40, 32, 53, 24];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwAges.join("
");
}

function tnwFun2(){
const result = tnwAges.filter(chkAge);
document.getElementById("demo").innerHTML = result.join("
");
}

function chkAge(age){
return age > 20;
}

Comments:

No comment to show.

Available Services
Download Android Application