DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
how to push only unique values in array in javascript
if(this.items.indexOf(item) === -1) { this.items.push(item); console.log(this.items); }
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#push
#unique
#values
#array
#javascript
ADD COMMENT
Topic
COMMENT
Name
9+3 =
Submit