html javascript - array remove (splice)
const arr0 = [0,1,2,3,4,5,6,7]const arr1 = arr0.splice(1,3)console.log(arr0) // [0,4,5,6,7]console.log(arr1) // [1,2,3]const arr2 = ['O', 'I', 'II', 'III', 'IV', 'V', 'VI']arr2.splice(1, 0, 'a') // insertconsole.log(arr2) // ['O', 'a', 'I', 'II', 'III', 'IV', 'V', 'VI']arr2.splice(4, 1, 'b') // replaceconsole.log(arr2) // ['O', 'a', 'I', 'II', 'b', 'IV', 'V', 'VI']const arr3 = [ { name: 'arr..
html javascript - array filter
const arr0 = ['car','bus','aircraft','spacecraft','car1','motorcycle','car'] const arr1 = [ {name: 'car', type: 'land', cost: 100}, {name: 'bus', type: 'land', cost: 50}, {name: 'aircraft', type: 'sky', cost: 200}, {name: 'motorcycle', type: 'land', cost: 80}, {name: 'spacecraft', type: 'space', cost: 1000}]const arr2 = [5,3,21,6,50,100,1,10,12,20,2]const filter0 = arr0.filter(str => s..