MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / getRandomUser

Function getRandomUser

assets/js/ArrayMethods.js:14–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12getRandomUser();
13
14async function getRandomUser() {
15 const res = await fetch("https://randomuser.me/api");
16 const data = await res.json();
17 console.log(data);
18
19 const user = data.results[0];
20 console.log(user);
21
22 const newUser = {
23 name: `${user.name.first} ${user.name.last}`,
24 money: Math.floor(Math.random() * 1000000),
25 };
26
27 addData(newUser);
28}
29
30function doubleMoney() {
31 data = data.map((user) => {

Callers 1

ArrayMethods.jsFile · 0.85

Calls 1

addDataFunction · 0.85

Tested by

no test coverage detected