export class ArrayExtension {
static Toggle(array,value, isEqual = (item1, item2)=> item1 === item2){
const res = array.slice()
const index = res.findIndex(x=>isEqual(x,value))
if(index != -1){
res.splice(index,1)
}else{
res.push(value)
}
return res
}
}