Skip to content

Instantly share code, notes, and snippets.

@frivolta
Created April 12, 2021 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frivolta/89f439313e0ac89225a9ed6dcac613db to your computer and use it in GitHub Desktop.
Save frivolta/89f439313e0ac89225a9ed6dcac613db to your computer and use it in GitHub Desktop.
jmawd - first solution
const result = []
for (let i = 0; i < firstArr.length; i++) {
if (result.indexOf(firstArr[i]) == -1) result.push(firstArr[i])
}
for (let i = 0; i < secondArr.length; i++) {
if (result.indexOf(secondArr[i]) == -1) result.push(secondArr[i])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment