Мне нужно отфильтровать массив с двумя условиями с null
и ''
items:any=[
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
},
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
},
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
},
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
},
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
},
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
},
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
},
{
amount : '',
payee_name : '',
misc :'',
type :'',
status : "cash",
identify:Math.floor(Math.random() * 100) + 1 ,
is_check : 1
}
];
let p;
p=this.items.filter(item => item.amount !== ''||null);