Skip to content

Commit b5ba544

Browse files
Create user.js
1 parent 2becd65 commit b5ba544

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

scripts/user.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function generateUser() {
2+
return "USER" + Math.randomRange(1000, 9999);
3+
}
4+
generateUser();
5+
6+
function createImg() {
7+
fetch("https://github.com/DeveloperTryingToCodeLikeOtherOfThem/pxt-hardware-programming-docs/blob/master/docs/static/userProfile.png")
8+
.then(res => res.blob())
9+
.then(blob => {
10+
const imgURL = URL.createObjectURL(blob);
11+
const img = document.createElement("img");
12+
img.src = imgURL;
13+
document.body.appendChild(img);
14+
});
15+
}

0 commit comments

Comments
 (0)