How do I set the value of my textarea containing all values from my array in random order? I currently have 2 issues:
- If I loop through the array, it puts only one element into the textarea
- I do not want elements to be duplicated
Here is my code
var area = document.getElementById('area');
var arr =['www.google.com','www.bing.com','www.yahoo.com','www.codecademy.com','twitter.com'
];
var rand = arr[Math.floor(Math.random()*arr.length)];
for(var i in arr) {
area.value = arr[i];
}