The exact javascript code needed depends first on where you are calling from. If your code resides inside the config.js file, that you pass into the WebViewer constructor, then the following should work.
var am = readerControl.docViewer.GetAnnotationManager();
annotation = am.getAnnotationById(previousHighlightKey);
if(annotation !=null)
{
am.HideAnnotation(annotation); // or am.hideAnnotation(annotation);
}
If you are calling from your HTML side, then it would be the following.
var am = myWebViewer.getInstance().docViewer.GetAnnotationManager(); // where myWebViewer is the default variable name for the WebViewer instance in the sample HTML files.
annotation = am.getAnnotationById(previousHighlightKey);
if(annotation !=null)
{
am.HideAnnotation(annotation); // or am.hideAnnotation(annotation);
}