const transportation = data.reduce((obj, item)=>{
if(!obj[item]){
obj[item] =0
}
obj[item]++
}, {})
- Array.sort()
const sorted = people.sort( (a, b) => {
const [aLast, aFirst] = a.split(', ')
const [bLast, bFirst] = b.split(', ')
return aLast > bLast ? 1: -1
})
- Nodelist不是Array 如何轉換
- Array.from(Nodelist)
- [... Nodelist]
- links.map(link=> link.textContent).filter(s -> s.includes('de'))