How to use the phone function from chance

Find comprehensive JavaScript chance.phone code examples handpicked from public code repositorys.

62
63
64
65
66
67
68
69
70
71
// phone number
person.attributes = [{
  attributeType: {
    uuid: REFAPP_TEL_PERSON_ATTR_UUID,
  },
  value: Chance.phone(),
}];

// patient identifiers (Luhn Mod 30)
const identifiers = [{
fork icon8
star icon16
watch icon5

+ 9 other calls in file

196
197
198
199
200
201
202
203
204
205
    } else {
        s += chance.paragraph().toCsv(CSV.delimiter);
    }
    break;
case 'phone':
    s += chance.phone().toCsv(CSV.delimiter);
    break;
case 'pick':
    fld = hdr[k].arg;
    s += chance.pick(fld.split('|')).toCsv(CSV.delimiter);
fork icon2
star icon8
watch icon0

16
17
18
19
20
21
22
23
24
25
exports.firstName = function () { return ch.first() }
exports.lastName = function () { return ch.last() }
exports.gender = function () { return ch.gender() }
exports.company = function () { return ch.capitalize(ch.word({syllables: 3})) }
exports.email = function () { return ch.email() }
exports.phone = function () { return ch.phone() }
exports.address = function () { return ch.address() }
exports.street = function () { return ch.street() }
exports.city = function () { return ch.city() }
exports.state = function () { return ch.state({full: true}) }
fork icon0
star icon2
watch icon1

+ 3 other calls in file

125
126
127
128
129
130
131
132
133
134
}
async.forEach(_.range(1, businessCount + 1), function (nr, cb) {
    var data = {
        "name": moniker.choose() + " b" + nr,
        "type": _.random(1, 3),
        "telephoneNumber": chance.phone(),
        "picture": "assets/i/business-logo-" + _.random(1, 3) + ".png",
        "description": chance.paragraph({sentences: 3}),
        "businessHours": _.random(1, 5) + ":00-" + _.random(9, 12) + ":00",
        "website": chance.url({path: "/"}),
fork icon0
star icon1
watch icon0

22
23
24
25
26
27
28
29
30
31
    age: chance.age(),
    birthday: chance.birthday({string: true, american: true}),
    gender: gender,
    zip: chance.zip({plusfour: true}),
    ssnFour: chance.ssn({ ssnFour: true }),
    phone: chance.phone(),
    email: chance.email()
}

spec.list.push( person );
fork icon0
star icon1
watch icon0

3
4
5
6
7
8
9
10
11
12
13
const Asset = require('../../lib/models/Asset');


module.exports = async({ jobCount = 5, noteCount = 60, resumeCount = 10 } = {}) => {
  const jobsArray = [...Array(jobCount)].map(() => ({
    title: chance.profession(),
    author: chance.phone(),
    company: chance.company(),
    active: chance.bool(),
    jobDescriptionText: chance.word(),
    jobUrl: chance.word(),
fork icon2
star icon0
watch icon0

12
13
14
15
16
17
18
19
20
let autor = message.author;

let correos = dominios[Math.floor(Math.random() * dominios.length)];

let ip = chance.ip();
let numero = chance.phone({ country: "us", mobile: true });
let correo = chance.email({ domain: correos });

let contraseña = chance.word({ length: 8 });
fork icon0
star icon0
watch icon0

48
49
50
51
52
53
54
55
56
57
58
59
	return chance.name(options)
}


// phone
export function phone (options) {
	return chance.phone(options)
}


// sentence
export function sentence (options) {
fork icon0
star icon0
watch icon0

127
128
129
130
131
132
133
134
135
136
    givenName: chance.first(),
    familyName: chance.last()
},
emailAddress: chance.email(),
emailType: 'Home',
phoneNumber: chance.phone(),
phoneType: 'Mobile',
street: chance.address(),
city: chance.city(),
state: chance.state(),
fork icon0
star icon0
watch icon0

+ 3 other calls in file