Question: i am used in Angular and Nativescript. I would like to try Typescript only template for nativescript (tns create myApp --template tsc)... but i need to have a shared Service as i would in Angular... can this be done in Vanilla typescript Nativescript ?

Thanks in advance

Answer: 
How about `String.indexOf()`?

```
if (tag_count != 11 && -1 === tag_array.indexOf(tag)) {
  tag_array += tag + ", ";
  tag_count = ++;
  $(".tags").append("<div style=\"margin: 5px;\" class=\"tag\"><p>" + tag + "</p><a href=\"#\">x</a></div>");
} else {
  ..
}

```
You should try using a [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instead of an Array. This way each entry will be unique.

```js
const set1 = new Set(["Apple", "Orange"]);
set1.add("Apple");
console.log(Array.from(set1));
```