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);

```
You could use something like this:

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

    // log our initial output
    console.log ( "colors: " + colors );
    console.log ( "randomColors: " + randomColors );

    // this is the loop that pulls colors out of the colors array at random and assigns them to the randomColors array
    // this function is destructive on the colors array, so copy it first if you want to keep the array intact
    // The iterations var can be changed to however many you like, but it will fail if you specify a number larger
    // than there are colors in the array
    var iterations = 3;
    for ( var i = 0; i < iterations; i++ ) {
        // grab a random color from the initial array
        var item = colors[Math.floor(Math.random()*colors.length)];
        var idx = colors.indexOf(item);
        // add it to the randomColors array
        randomColors[i] = item;
        // remove it from the colors array so it isn't picked again
        colors.splice(idx, 1);
    }

    // log our resultant output for comparison
    console.log ( "colors: " + colors );
    console.log ( "randomColors: " + randomColors );

```