I have string like this in javascript at LoggerService.log (/Users/apps/api/webpack:/pcs-goc-api/pcs-libs/logger/src/logger.service.ts:107:29) I want to extract logger.service from it. the formula is between last / to last . I can extract from last / using /([^/]+$)/g but don’t know how to limit the fin…
Category: Questions
React/Redux Toolkit render issue when deleting state from an array
Problem: Component render starts to drift from actual state Desired Output: Component render matches state. So. I’m going to give a bit of a high-level overview with pseudocode as this issue is quite complex, and then I’ll show the code. I have a main form, and this form has an array of filter-sta…
Slick Carousel – RTL function
I am facing an issue in Slick Carousel to work in both LTR and RTL. It works by default in LTR, but when I change the page to RTL I get a blank container. There is an option “rtl: true” but that would make it always working in rtl. I have tried to add a conditional function in JS file
Using window.open in an async function in Firefox and Safari
The application I work on integrates with some platforms with some strict security policies when it comes to user authentication, and as such authentication from our side has to be handled a bit differently as well. The details here aren’t terribly important. I’m working on a new feature now where…
Displaying data from a google sheet onto an html table
As the title says, I’m having some issues properly displaying data from a google spreadsheet onto a table in HTML. For context, what my program is supposed to do is: when the button ‘New Alert’ is pressed, a form pops up that allows for user input. After inputting all the information that th…
What’s the order of execution when we have callback inside promise?
I am new to JavaScript and, am not able to understand why the output of the following code:- is:- and not:- additionally, console.log(“async executed”) is not getting lagged for 10 seconds, instead, it gets executed immediately after the two synchronous console.log Answer As commented by @trincot,…
Stop navigation if another link is clicked Angular
I have a form in angular and when it is submitted, there is a redirection to homepage after X seconds. Here is the service containing the redirection method: Here is the submit method: I’d like to know how can I stop redirectToHome() if suppose an user click somewhere else in the menu before x seconds h…
How to force JAVA app to open the page in specific browser
When I add microsoft-edge prefix to the URL(microsoft-edge:https://google.com) it opens the page in edge regardless what browser i am using to run the app. Is there an equivalent prefix for chrome and Firefox ? Thank you in advance Answer If you are using Java and you want to run a certain browser with a cert…
Send data to server using Axios VueJs
It is necessary to send data to the server in the required format, I don’t understand how to organize it correctly, the same JSON structure. You must send when attaching a file (@change), the file itself and a comment. Here is what I was able to do https://codepen.io/JessikaJes/pen/rNvgYwP Answer Change the c…
how to calculate zero values in array between two valid numbers?
I have an array of numbers with some 0 values. I want to fill 0 with the linear difference between two valid values. let arr = [10,0,0,16,17,0,23] I am using the below code to calculate the linear difference between the two data points if they have zero between them like 10 and 16 have two indexes with 0, if …