Question: I have a string like this,

```
var str = " This is a ?sample? text to ?extract? question marks separated texts into an array in ?Javascript?. "

```

I want a javascript array as below,

```
arr = {
        'sample',
        'extract',
        'Javascript'
      }

```

Answer: 
You need to ensure that the event is not passed again to the outer container.
In your case the event is triggered by the inner element which leads to a hideMenu but afterward the event is propagated to the outer container which leads to a recall of showMenu.

Additional reading about the can be found here:
<https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation>
<https://www.w3schools.com/jsref/event_stoppropagation.asp>

Seems like Padi Dev also found the problem before me :)
really weird but could you try imitating what I did in this code sandbox?
<https://codesandbox.io/s/heuristic-fire-2jp8n?fontsize=14&hidenavigation=1&theme=dark>

that should be as simple as it gets