filter somthing by some value without repeat

PHOTO EMBED

Wed Mar 16 2022 11:28:26 GMT+0000 (UTC)

Saved by @KhaledOghli #javascript

    getMasterName(index) { 
      const types = new Set()
			this.request.details.buildings[index].details.usages?.forEach((usage) => types.add(usage?.masterUsageId))
      const data = Array.from(types).map((masterUsageId) => {
        debugger
				const filterdData = this?.masterUsages.filter((i) => i?.id == masterUsageId)
				return {
					masterUsageId: masterUsageId,
					name: filterdData[0]?.name,
					// items: filterdData,
				}
			})
			return data

    },
content_copyCOPY

using type to remove repeat same value