If you're working with a date string, consider wrapping it in a date object and using the getHours() function on that object.
// Create a new date object 'oldDate' by passing the date string as a parameter
let oldDate = new Date("date string");
// Creating another date object 'systemDate' without parameters will use the system time
let systemDate = new Date();
if(oldDate.getHours() == systemDate.getHours())
Alternatively, if you are confident that the response will be in the form of "10:50", this could be a better approach:
let time = "10:50";
let h = parseInt(time.split(":")[0]);
let systemDate = new Date();
if(h == systemDate.getHours())