phone
phoneNumber​
Description​
Method that generate random phone number
Parameters​
Name | Type | Description |
---|---|---|
format | <String> | You can define what format to use. If the parameter passed isn't valid it will randomize from internal list |
Returns​
- <String>
Usage​
Without passing parameters
- code
console.log(pure.phone.phoneNumber());
- result
'026 579 44332'
Describing that i want an phone number following the pattern
(##) ####-####
- code
console.log(pure.phone.phoneNumber('(##) ####-####'));
- result
'(23) 5598-3239'
phoneNumberFormat​
Description​
Method that generate random phone number based on localization that you have set. If your locale has more than one phone format you can hard pass what index you want
Parameters​
Name | Type | Description |
---|---|---|
phoneFormatsArrayIndex | <Number> | Index to use when retrieving format from locale. Default value is 0 |
Returns​
- <String>
Usage​
Without passing parameters
- code
console.log(pure.phone.phoneNumberFormat());
- result
'017 247 00083'
Describing that i want an phone number respecting the second item from the defined locale
- code
console.log(pure.phone.phoneNumberFormat(1));
- result
'022 944 84372'
phoneFormats​
Description​
Method that returns random phone format respecting the defined locale
Parameters​
Name | Type | Description |
---|---|---|
N/A | N/A | This method doesn't receive any parameters |
Returns​
- <String>
Usage​
- Without passing parameters
- code
console.log(pure.phone.phoneFormats());
- result
'01# ########'