The Solution with O(n) time complexity to get first unique element from an array.
const nums = [4,2,2,1,3,3]
const result = new Map()
for (const num of nums) {
result.set(num, (result.get(num) || 0) + 1)
}
const uniqueNum = nums.find((num) => result.get(num) === 1)
console.log(uniqueNum)