Question: I currently have the hidden attribute of one of my divs binded to a boolean in my typescript. But, when I am changing the value of the boolean in one of my function calls nested within an object the dom is not updating on the front end? 

**typescript**

```js
hideSymbols = true;

bindings = {
    enter: {
      key: 13,
      handler: function() {
        console.log('enter pressed');
        this.hideSymbols = !this.hideSymbols;
        console.log(this.hideSymbols);
      }
    }
  };
```

**html**

```js
<div [hidden]="hideSymbols">
   <button id="equalsBtn" class="symbolBtn">=</button>
   <button id="impliesBtn" class="symbolBtn">=></button>
</div>
```

It works if I am not making the call in this handler but I need to in order for my ngx-quill instance to update how the enter key works. Essentially, **why is hideSymbols getting updated but on my web view the element does not disappear and reappear?**

Answer: 
The easiest way is to use `shuffle` function in **lodash** package. <https://lodash.com/docs#shuffle>  

Then select the the number of colors you want from the randomized array:

```
const colors = ['blue','red','orange','purple','gray','yellow'];
const selectedColors = _.shuffle(colors).splice(0, 3);  // 3 random colors
console.log(selectedColors);

```
```
let excludedIndexes = [];
let currentIndex = null;
let colors = ['blue','red','orange','purple','gray','yellow'];
let randomColors = [];

function getNextRandom(max)
{
    return Math.floor(Math.random()*max);
}

function addColors(numColors)
{
    let i = 0;
    randomColors = [];
    excludedIndexes = [];
    while(i < numColors)
    {
        currentIndex = getNextRandom(colors.length);
        while(excludedIndexes.indexOf(currentIndex)!=-1)
        {
            currentIndex = getNextRandom(colors.length);
        }
        randomColors.push(colors[currentIndex]);
        excludedIndexes.push(currentIndex);
        i++;
    }
}
addColors(3);//modifies the randomColors array each time it's called

```

Tested in the browser console.

Had to fix a couple lines, but this should work fine now.