1var pre = document.getElementById('out');
2
3function log(result) {
4 pre.appendChild(document.createTextNode(result + '\n'));
5}
6
7var review = ['a', 'a', 'b', 'c', 'b', 'a', 'a'],
8 index = review.indexOf('a');
9
10while (index !== -1) {
11 review.splice(index, 1);
12 index = review.indexOf('a');
13}
14
15log(review);