Get unique values out of an array

let categories = [...new Set(data.map((crime) => crime.category))]

Please note that this site and the posts on it are, and will always be, a work in progress. If i waited for perfection, i’d never get anything done.