Skip to content

Category: Questions

Regex to match string in a sentence

I am trying to find a strictly declared string in a sentence, the thread says: Find the position of the string “ten” within a sentence, without using the exact string directly (this can be avoided in many ways using just a bit of RegEx). Print as many spaces as there were characters in the origina…

How to sum duplicated values inside array in order

I need some help to sum values inside an array in order I have two arrays: I’m using this code below to remove the duplicated values inside array1: What I need is to sum the values of array2 using the order of array1, so I will have this result: So the final result would be this: Any suggestion ? thank

Cursor trail algorithm for p5.js

I found this little coding exercise on Processing’s website (https://processing.org/examples/storinginput.html) and decided to make a p5.js version of it. The part that I do not understand about this algorithm is how the ellipses drawn (in the trail) shrinks when variable i, which is used as the scale o…

function to find an element inside the array [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question I wrot…

countDocuments() is not working in api call

I am trying to get a count of products using api calls but in postman its keep loading without async and await also its not working I try to catch the error and i got this error in postman code to catch error: Answer I think in Mongoose operations you want to either await or provide a callback, but not

use a custom number format for money in HTML

i have an interactive report in my apex page with numbers (money) in it, the default money format is U.S which is like this : ###,###,###,###.## what i need is this : ### ### ### ###,## is there a …