In addition to David's answer, yes, this can be done with JavaScript as well.
You can use the getAnnots() method of the Document object to retrieve the annotations, and if that array is not empty you can iterate over it, calling the destory() method for each Annotation object to remove it.
So something like this:
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null && annots.length!=0)
for (var i in annots) annots[i].destroy();