Skip to content

Tag: javascript

Need help to match regex with conditional concatenation (JS)

I need help to accomplish the use cases of this regex: https://regex101.com/r/HmDQHJ/3/ Right now, my issue is that I need to match this: But also fail on this: Can someone help me to accomplish this? Thank you! More context: We have an old crawler that goes project source and looks for usage of a function ca…

Dynamic change of global variables in react native

I have an mqtt client inside my react native app and it constently receives data from a broker. This data is being used in many different screens/components differently (I have 1 class which extends React.Component per screen). For example I show the data I receive from topic x on screen 1 while I show the da…

Uncertainty with the !! operator (double negation)

I saw in a pull request that the double negation operator (!!) is used for the focus attribute of a text field as follows: As far as I know, the operator converts everything to a boolean. If it was falsy (for example 0, null, undefined,..), it will be false, otherwise, true. In my case, i.e. if value = 0, the

position charts on html page

Im building a basic dashboard and using google charts to do so. I have successfully embedded my gauge charts on the webpage. I am now trying to position them. I have read that this needs to be done using css positioning. My question is if this is the solution , how can I use this within my code. Im trying

How to close mask

I have created a hamburger menu that opens with the mask in the background (mask opens after 4ms). Next, on closing the hamburger menu, I want that mask to close with it (means after 4ms). But instead, according to my code, my mask is not closing after my hamburger menu closes. JS: I just want that mask to di…