<script>
var arr = [];
function repeater(str){
for (var i=0; i<str.length;i++)
{arr.push(str[i])}
arr.sort()
for (var g=0;g<arr.length;g++) {
if (arr[g]==arr[g+1])
{return false}
else {return true}
}
}
document.write(repeater("jrtgrt"))
console.log(arr)
</script>
Create a function that takes a string and returns either true or false depending on whether or not it has repeating characters.
The array is working by console, but the second part doesn't seem to be running.