henriquesouza182
9/7/2017 - 10:02 PM

Arrays

How to work with arrays

["bar", "baz", "foo", "foo", "qux"]
 
for( var i = list.length-1; i--;){
if ( list[i] === 'foo') list.splice(i, 1);
}
 
["bar", "baz", "qux"]
items.forEach(element => {
    this.stations.splice(this.stations.indexOf(element.IATA), 1) ;
});