Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let ds = (time.match(/m/g)||[]).length;
- let hs = (time.match(/h/g)||[]).length;
- let ms = (time.match(/m/g)||[]).length;
- if (ds > 1) console.log("You can't have more than 1 occurance of 'd'");
- if (hs > 1) console.log("You can't have more than 1 occurance of 'h'");
- 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