Skip to content

Commit e7ff9c7

Browse files
author
russom
committed
Inline code directly into return statement
1 parent c2f743c commit e7ff9c7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎format-clock-edge-cases/timeConverter.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ function formatAs12HourClock(time) {
1010
return `12:${minutes} PM`;
1111
}
1212
if (hours > 12) {
13-
const paddedHours = String(hours - 12).padStart(2, "0");
14-
return `${paddedHours}:${minutes} PM`;
13+
return `${String(hours - 12).padStart(2, "0")}:${minutes} PM`;
1514
}
1615
return `${time} AM`;
1716
}

0 commit comments

Comments
 (0)