1) JS tricky output question. 2) Reverse the whole array. let arr = ['js', 1, 2, 'js', 1, 'interview', '2', true, 'interview']; DESIRED OUTPUT: [ 'weivretni', 'sj', 8, 7, 6, 'modnar', 4, 3, 2, 1 ]; 3) Remove duplicates from the array. let arr = ['js', 1, 2, 'js', 1, 'interview', '2', true, 'interview']; DESIRED OUTPUT: Result = >[ 'js', 1, 2, 'interview', '2', true ]
Anonimo
questions were easy but I am doing it through a traditional approach. can be done through built-in functions like filter() & reverse().