0

Ever since I started my journey as a Javascript developer, I am facing problems. I tried to solve this query but couldn't find the right solution and was stuck with this error.

here is: var myArray = ['a', 1, 'a', 2, '1']; var unique = myArray.

Help me to provide the best solution which will help me a lot.

  • 1
    Does this answer your question? [Get all unique values in a JavaScript array (remove duplicates)](https://stackoverflow.com/questions/1960473/get-all-unique-values-in-a-javascript-array-remove-duplicates) – JosefZ Jul 08 '22 at 18:23

1 Answers1

0

try this :

var array = new Array('a', 1, 'b', 2);
for (let i = 0; i < array.length; i++)
      console.log(array[i]);
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 11 '22 at 01:30