instance of Notification object

Access the instance of Notification object:

<notification-alert message="Hi there!"></notification-alert>
<script>
var notifications = [];

function showNotification(){
   var notification = document.querySelector('notification-alert');
   notification.notify();
   notifications.push(notification.instance);
}

function closeNotification(instance){
  instance.close();
}  

function closeAllNotifications(){
 for(var x = 0; x < notifications.length; x++ ){ 
   var tmp = notifications[x].pop();
   closeNotification(tmp);
 }
}         
</script>