Turned tags array into a Set

to avoid duplicates and have unique values.
pull/81/head
Sinisa Vukmirovic 4 years ago committed by GitHub
parent f682234a3c
commit 5487b3cd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,9 @@ textarea.addEventListener('keyup', (e) => {
}) })
function createTags(input) { function createTags(input) {
const tags = input.split(',').filter(tag => tag.trim() !== '').map(tag => tag.trim()) const tags = new Set(input.split(',')
.filter(tag => tag.trim() !== '')
.map(tag => tag.trim()))
tagsEl.innerHTML = '' tagsEl.innerHTML = ''

Loading…
Cancel
Save