main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
326 bytes
|
Line | |
---|
1 | function addIfNew(list, value) {
|
---|
2 | if (list.indexOf(value) === -1) {
|
---|
3 | list.push(value);
|
---|
4 | }
|
---|
5 | }
|
---|
6 |
|
---|
7 | export default function addNewValuesOnly(list, values) {
|
---|
8 | if (Array.isArray(values)) {
|
---|
9 | for (var i = 0, len = values.length; i < len; ++i) {
|
---|
10 | addIfNew(list, values[i]);
|
---|
11 | }
|
---|
12 | } else {
|
---|
13 | addIfNew(list, values);
|
---|
14 | }
|
---|
15 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.