2,522,110 questions
Score of 0
1 answer
12 views
Is /[\s\S]/ the same as saying /.|\n/ in regex
I assumed in regex that saying:
/[\s\S]/
means the same as saying:
/.|\n/
But then I discovered that in JavaScript the line separator <0x2028> and the paragraph separator <0x2029> do not ...
Score of -3
0 answers
25 views
How should I handle dependent API requests and stale state in React? [duplicate]
I'm working on a React application where I have a form that loads data from multiple APIs. One API returns the selected customer, and based on that customer I need to fetch their accounts.
The problem ...
Score of -1
0 answers
46 views
Generating grouped PDF from paginated API data in React/jsPDF without loading all rows into memory
I am generating a financial report PDF in a React application using jsPDF + jspdf-autotable.
The report is grouped by Account Head and has three levels of totals:
Account total (same account number)
...
Score of 2
1 answer
99 views
Avoid synthetic sounds overlapping
I have the following simple program in HTML and JavaScript:
<body>
<div id = "button-container" class="synth">
<button class = "note" id = "...
Score of -2
0 answers
70 views
How can I prevent JavaScript from running before the DOM is fully loaded? [duplicate]
I'm working on a small JavaScript project where need to select an HTML element and add an event listener to it.
The script is currently loaded in the <head> section, and sometimes document....
Score of -6
0 answers
108 views
How can I automatically scale a web application for different screen resolutions and display scaling?
I am using Bootstrap via CDN, and I use my web application across three different monitors. Since the monitors have different resolutions and scaling settings, the application appears at different ...
Score of -1
2 answers
81 views
How do I export a JavaScript project from Dashtera platform? [closed]
My goal
I'm trying to figure out how to generate JavaScript project from Dashtera dashboard designer. The designer enables drag-drop design of the dashboards, and connecting data in them, and viewing ...
Score of -3
2 answers
161 views
How do I make it so that the script responds differently for each element?
I'm trying to make it so that each button opens up a different dialog box.
The script I use only allows for one dialog box, but not the other.
<html>
<style>
body{
...
Score of -9
1 answer
111 views
Learning Passport.js has me completely lost & overwhelmed. How Much Do I Actually Need to Know? [closed]
How deeply should I understand Passport.js?
I'm currently learning web dev and have reached Passport.js for authentication. I'm getting a bit overwhelmed by all the functions, callbacks, middleware, ...
Score of 2
1 answer
159 views
Show javascript text on an html file
I have written a program which calculates the average between two teams, as follows:
function game(){
console.log("Hi everyone and Welcome to the Clash of Teams!")
console.log("...
Score of -7
1 answer
115 views
Pointers and references in Javascript [closed]
I have an object that is being pointed to by many keys on a map. How do I change the object?
this.map.get(x+1) = newObject
this.map.get(x-1) = this.map.get(x+1)
Both result in:
Invalid left-hand ...
Score of 1
0 answers
37 views
Why does my async function return a pending Promise instead of the resolved value when I call it inside a forEach loop [duplicate]
I am trying to fetch data for a list of user IDs using forEach but the function returns before any of the async calls finish.
async function getUsers(ids) {
let results = []
ids.forEach(async (id) ...
Score of -4
0 answers
138 views
Why currentUser below is empty while currentUser above is not? [closed]
I run a login form; upon completion, I store the userId and navigate to the Home page. In App.jsx, I retrieve the userId, and if I don't have one I display the Login page. I am successfully retrieving ...
Score of -3
0 answers
70 views
Why something executes before something else? [duplicate]
I've been struggling to understand why line marked 2 executes before the function in line marked 1 returns a value:
// this gets called when we press the add button
function addNewItemButton() {
//...
Score of 0
1 answer
53 views
Fixing a GNOME Shell St.ScrollView 1px layout collapse under unconstrained sizing queries
When developing a custom GNOME Shell extension or UI component in GJS (JavaScript), a custom grid widget inside an St.ScrollView within a vertical St.BoxLayout collapses to a height of 1px and becomes ...