Wie man das vernetzte Internet in JS kennt

// example code
let Connected = window.navigator.onLine;
if (Connected) {
  alert('Connection available');
} else {
  alert('Connection not available');
}
Abhay Mishra