const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck', 'pogostick'];
const transportation = data.reduce((total, item) => {
if(!total[item]){
total[item] = 0
}
total[item]++
return total
},{})
console.log(transportation)