Skip to content

Instantly share code, notes, and snippets.

View tabathamor's full-sized avatar
🎯
Focusing

Tabatha moreno tabathamor

🎯
Focusing
  • Seattle
  • 11:02 (UTC -12:00)
View GitHub Profile
@tabathamor
tabathamor / time-conversion.js
Created December 15, 2022 00:41
time conversion hacker rank javascript
function timeConversion(s) {
// substring the AM/PM from the string
let clean = s.substring(0, 8)
// we divide our string with a split by :
let nerArr = clean.split(':');
// Check if the string (s) includes PM
if(s.includes("PM")){
// If our first position it's different than 12
if(nerArr[0] !== '12'){