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

Function randomSelect

assets/js/random_choice_picker.js:31–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31function randomSelect() {
32 const times = 30
33
34 const interval = setInterval(() => {
35 const randomTag = pickRandomTag()
36
37 highlightTag(randomTag)
38
39 setTimeout(() => {
40 unHighlightTag(randomTag)
41 }, 100)
42 }, 100);
43
44 setTimeout(() => {
45 clearInterval(interval)
46
47 setTimeout(() => {
48 const randomTag = pickRandomTag()
49
50 highlightTag(randomTag)
51 }, 100)
52
53 }, times * 100)
54}
55
56function pickRandomTag() {
57 const tags = document.querySelectorAll('.tag')

Callers 1

Calls 3

unHighlightTagFunction · 0.85
pickRandomTagFunction · 0.70
highlightTagFunction · 0.70

Tested by

no test coverage detected