Advertisement
crescentfresh

Untitled

Apr 14th, 2022
1,142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let ds = (time.match(/m/g)||[]).length;
  2. let hs = (time.match(/h/g)||[]).length;
  3. let ms = (time.match(/m/g)||[]).length;
  4. if (ds > 1) console.log("You can't have more than 1 occurance of 'd'");
  5. if (hs > 1) console.log("You can't have more than 1 occurance of 'h'");
  6. if (ms > 1) console.log("You can't have more than 1 occurance of 'm'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement