Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test = (input) => {
- const regex = new RegExp ('[!@#$?]','g')
- input.forEach(element => {
- let reworked = element.split(regex).join('')
- let geohash = reworked.split('=')
- let name = geohash.shift()
- geohash = geohash.join('').split('<<')
- const valid =() => {
- if(geohash[1] !== undefined && geohash[0]!==undefined) {
- if(Number(geohash[0])=== geohash[1].length && (name.match(new RegExp('[a-z0-9]','gi')).join('') === name)) {
- return true
- }else {
- false
- }
- }
- }
- if(valid()){
- console.log(`Coordinates found! ${name} -> ${geohash[1]}`)
- }else if(element !== 'Last note'){
- console.log(`Nothing found!`)
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement