- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
In the end, it's time to brush up on fixing your hyperlinks.
Admin
The real solution is, normalize phone numbers and calling countries. Then, a lot of these problems go away
Admin
Because I'm a nice guy, here's the link:
https://github.com/google/libphonenumber/blob/master/FALSEHOODS.md
Admin
peers at the "victims" array with great suspicion
Is this...is this phone scam code?
Admin
I didn't think for ... in worked like that in Javascript. Shouldn't it be using i.country_code and not item.victims[i].country_code ?
Admin
That is how
for...in
works in JS. it iterates over object keys, not values; in the case of an array, the keys are the indexes.EcmaScript 6 added
for (var of array)
which iterates over the values.Admin
Nah, the real solution is carrier pigeons. :)
Admin
Phone numbers are like timezones/dates. Just get a lib that does it right and stop reinventing the wheel.
Admin
Not to mention that you can't just concatenate the country code and in-country telephone number in many countries.
For example, my UK mobile telephone number starts
07884...
. The zero indicates it has a "standard trunk dialling" code on the front. i.e. it works from anywhere in the UK (in olden days, with fixed lines, you could drop the STD and just dial the last six numbers for anybody else in the same area with the same STD, which was a time saver with dial operated telephones). The international version of my number drops the zero, so it begins+447884...
, 44 being the UK's country code.