Skip to content

Commit 74ffa53

Browse files
author
calypso
authored
ES6 douglos
2 parents 90ab5ef + 506f3fe commit 74ffa53

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Douglos
2+
3+
All images have a 10% chance of being replace by **DOGLOS MAKONHA \_\\|/_**
4+
<img src="https://i.imgur.com/XSrHlah.jpg">

douglos.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
var imgs = document.getElementsByTagName('img');
1+
window.onload = () => {
2+
const imgs = [...document.getElementsByTagName('img')]
23

3-
for(var i = 0; i < imgs.length; i++) {
4-
if (Math.random() >= 0.9) {
5-
imgs[i].src="https://i.imgur.com/XSrHlah.jpg"
6-
}
4+
imgs.forEach(img => {
5+
if (Math.random() >= 0.9)
6+
img.src = "https://i.imgur.com/XSrHlah.jpg"
7+
})
78
}

0 commit comments

Comments
 (0)