var pre = document.getElementById('out');
function log(result) {
pre.appendChild(document.createTextNode(result + '
'));
}
var review = ['a', 'a', 'b', 'c', 'b', 'a', 'a'],
index = review.indexOf('a');
while (index !== -1) {
review.splice(index, 1);
index = review.indexOf('a');
}
log(review);