Join the DZone community and get the full member experience.Join For Free
However, you can use Chance.js for all your other random needs. Chance.js can generate random value for all the common data types like: bool, character, floating, integer, natural and string.
Chance.js can also generate random text like: paragraph, sentence, syllable and word. Check out the Chance.js website to get a full description of the various type of random data the library can generate. Below is a list of the different data type:
- Text: paragraph, sentence, syllable, word.
- Person: age, birthday, first, gender, last name, prefix.
- Web: color, domain, email, fbid, google_analytics, hashtag, ip, ipv6, klout, tld, twitter.
- Address: address, areacode, city, coordinates, latitude, longitude, phone, postal, province, radio, state, street, tv, zip.
- Time: ampm, date, hammertime, hour, millisecond, minute, month, second, timestamp, year.
- Finance: cc, cc_type, dollar, exp, exp_month, exp_year.
Published at DZone with permission of Hirvesh Munogee , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.