Zdobądź format hh mm am w JavaScript

var time = new Date();
console.log(
  time.toLocaleString('en-US', { hour: 'numeric', hour12: true })
);  
Exuberant Eel