The task is to select unique objects from the array, and make them lower case. At the step, when I brought the array into one line and changed the register, everything is fine, but when I add a selection of unique objects, the terminal issues: TypeError: tre.reduce is not a function
var names = ['web', 'interner', 'JavaScript', 'Internet', 'script', 'programming']; var tre = names.join().toLowerCase(); var uniq = tre.reduce(function(a,b){ if (a.indexOf(b) < 0 ) a.push(b); return a; },[]); console.log(uniq);
reducethe array method, and you apply it to the string, because of this error - Rostyslav Kuzmovychmapfunction for this - Rostyslav Kuzmovych