Easy
This question is a daily question and will count towards your daily streak.
Working on a notification system, you need to format user messages. What will be the output of this formatting utility?
1class MessageFormatter {2 static format(message, user, time) {3 return message4 .replace('{user}', user)5 .replace('{time}', time)6 .trim();7 }8}910function formatNotification(template, username) {11 const now = new Date('2024-01-04T10:30:00');12 const time = now.toLocaleTimeString('en-US', {13 hour: 'numeric',14 minute: 'numeric'15 });1617 return MessageFormatter.format(template, username, time);18}1920const template = "Hello {user}! Your meeting starts at {time} ";21console.log(formatNotification(template, "Alice"));