Last active
January 23, 2017 20:50
-
-
Save tfogo/2f680f71a2b2600f469a91eba719ae52 to your computer and use it in GitHub Desktop.
Test for primality for phone numbers from all the promises
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| phonePromise.then(data => { | |
| let verifiedPrimes = []; | |
| data.forEach(twilioObject => { | |
| twilioObject.available_phone_numbers.forEach(e => { | |
| if (primality(e.phone_number.slice(2)) && !verifiedPrimes.includes(e.phone_number.slice(2))) { | |
| verifiedPrimes.push(e.phone_number.slice(2)); | |
| } | |
| }); | |
| }); | |
| console.log(verifiedPrimes); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment