Skip to content

Tag: javascript

Accessing a common property in a factory function

Say I want to have a counter in a factory function that counts the number of objects that were made, I can do it as such: What this shows, is that the counter property is being saved and edited on the foo function object. But foo.counter is undefined. So my question is: Where is the property being saved and h…

How to toggle colors in list in Vue?

I have a tree-view component: my not working script: I just want to toggle the item’s color, which I choosed, that is when I click an item(im my code this item has @click event) I want to this item change its color to another, but its huge problem to me to turn back previous item to initial color. Ive s…

RegEx how I can find these 3 groups?

I have a string with three different texts inside the exact line, separated by a _ I want a regex to extract the first part of the data, a regex for the second, and one for the last part. The string is like xxxxxx_yyyyyyy_zzzzzz (where x, y, and z it’s random data). I have tried this: But I can only

filter Async data in Angular [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 8 m…

How to sort an array with special conditions

I just want to return an array containing the first and second objects based on the “point” property of an object and I have a condition below, When the condition is satisfied it will swap places. Given the following object: the result I want is Answer You could group the data with an object for t…