Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function easterEggs(input) {
- let string = input.shift()
- let path = /[@#]+(?<color>[a-z]{3,})[@#]+[^A-Za-z0-9]*[\/]+(?<digit>[\d]+)[\/]+/g
- let matches = string.matchAll(path)
- if (matches) {
- for (let match of matches) {
- if (match.groups.digit!==undefined && match.groups.color!==undefined) {
- console.log(`You found ${match.groups.digit} ${match.groups.color} eggs!`)
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement