Open swati-jagtap opened 3 years ago
`
function unique(arr) { var a=arr.toString(); for(let i=0;i<arr.length;i++) { if(a.indexOf(arr[i])!=a.lastIndexOf(arr[i])) { return `Array Items Are Not Unique`; break; } else { return `All Items Are Unique`; } } } console.log(unique([1,4,2,1,9,6])); console.log(unique([1,4,2,9,6])); console.log(unique([1,"s",9,6]));`
`
7.3.16--Write a functions which checks if all items are unique in the array.
output