- I want to know, why it says that the third "S is not defined", because S is defind
function startTime() {
  const today = new Date();
  var S = today.getHours();
  var m = today.getMinutes();
  m = checkTime(m);
  document.getElementById('txt').innerHTML = S + ":" + m;
  setTimeout(startTime, 1000);
}
function checkTime(i) {
  if (i < 10) { i = "0" + i };  // add zero in front of numbers < 10
  return i;
}
this S here
var a = S + m
    
if (a === 2215) {console.log("lol"); };
 
     
    