Write a function. Test real cases. Improve your solution.
Given an array of strings, return the issue labels after trimming their edges, dropping empty labels, and removing case-insensitive duplicates. Preserve the spelling of the first trimmed occurrence and the original first-occurrence order. Internal spaces remain unchanged. Use ordinary JavaScript toLowerCase for comparison. Leave the input array unchanged.
[
[
" Bug ",
"bug",
"UI",
"ui",
"Docs"
]
][ "Bug", "UI", "Docs" ]
[
[
"",
" ",
"\t",
" API "
]
][ "API" ]
[ [] ]
[]
[
[
"zeta",
"Alpha",
"ZETA",
"alpha"
]
][ "zeta", "Alpha" ]
[
[
"good first issue",
"good first issue"
]
][ "good first issue", "good first issue" ]
[
[
"__proto__",
"constructor",
"__PROTO__"
]
][ "__proto__", "constructor" ]
Your code runs in your browser. These exercises use synchronous JavaScript functions and built-in data types; DOM access, network requests, and npm imports are unavailable. Runs stop after about four seconds. Test results support self-study and don’t certify proficiency.