Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5b13821

Browse files
committed
used ES6 syntax
1 parent ce1e43c commit 5b13821

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Source-Code/ChoicePicker/script.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const textarea = document.getElementById('textarea')
33

44
textarea.focus()
55

6-
function createTags(input){
6+
const createTags = (input) => {
77
const tags = input.split(',').filter(tag=> tag.trim()!=='').map(tag => tag.trim())
88
tagsEl.innerHTML = ''
99
tags.forEach(tag => {
@@ -15,20 +15,20 @@ function createTags(input){
1515
});
1616
}
1717

18-
function pickRandomTag(){
18+
const pickRandomTag = ()=>{
1919
const tags = document.querySelectorAll('.tag')
2020
return tags[Math.floor(Math.random()* tags.length)]
2121
}
2222

23-
function highlightTag(tag){
23+
const highlightTag = (tag)=>{
2424
tag.classList.add('highlight')
2525
}
2626

27-
function unHighlightTag(tag){
27+
const unHighlightTag = (tag)=>{
2828
tag.classList.remove('highlight')
2929
}
3030

31-
function randomSelect() {
31+
const randomSelect = () => {
3232
const times = 30
3333
const interval = setInterval(()=>{
3434
const randomTag = pickRandomTag()

0 commit comments

Comments
 (0)