2,524,093 questions
0
votes
1
answer
28
views
Check arguments in JavaScript Object Literal Argument
Question: What is a method to organize the code to check arguments in Object Literal Argument?
This question concerns code clarity, code textual minimization, and effectiveness.
For example, take this ...
Best practices
0
votes
1
replies
59
views
How can I validate and pretty-print JSON in JavaScript?
I have a JSON string and I want to:
Validate if it's correct JSON
Format (pretty-print) it for better readability
What is the best way to do this in JavaScript?
Answer:
You can validate and pretty-...
0
votes
1
answer
52
views
How do I make my Jest tests, runnable in Node.js, compatible with Bun if I am using Babel transform from browser into Node.js-compatible JavaScript?
In my project I am using this babel.config.js file to convert from browser-compatible JavaScript into Node.js-compatible JavaScript before running my Jest tests:
module.exports = {
presets: [['@...
Advice
0
votes
8
replies
129
views
Is there any future for a JavaScript developer doing Gen-AI? Every single JD asks for Python — am I wasting my time?
I need to vent — and genuinely want to hear from people who've been in this spot.
I'm a passionate JavaScript developer. JS is not just my job, it's how I think. I've spent months going deep on ...
1
vote
1
answer
91
views
JavaScript fetch stream not working on iOS
I'm trying to read the stream response from my API in iOS (specifically Safari, but seems to be the same issue for any browser on iOS).
The issue appears to be when attempting to read the stream, in ...
-9
votes
0
answers
77
views
I wan't to make my site Conway's Game of Life faster by using compiler. How can I do it? [closed]
I wan't to make my site Conway's Game of Life faster by using compiler. How can I do it?
I maximised algorithm and I don't know what to do. Please help me.
(I think, I need to put here something:
<...
1
vote
1
answer
75
views
Chart.js not responding to resize in grid column [closed]
I need my chart to resize to the full width and height of it's container within a grid column. I've read through the documentation and made sure maintainAspectRatio is false and the container position ...
-1
votes
0
answers
60
views
Why are my async/await errors not being caught properly in my Node.js Express middleware? [closed]
I am building a REST API using Node.js with Express, and I’m running into an issue where errors thrown inside an async route handler are not being caught by my error-handling middleware.
const express ...
0
votes
0
answers
18
views
Hook errors in MUI Data Grid with fresh install [duplicate]
I am using a stripped down version of the example used in the documentation, however I get these errors:
Here's my code:
import Box from '@mui/material/Box';
import { DataGrid, type GridColDef } from ...
Advice
0
votes
4
replies
58
views
Prevent soft keyboard briefly dropping when focus lost because a button was pressed
I have implemented a search facility on text in an html textarea.
When a button is pressed, the search text is found in the text, the textarea is scrolled to bring the found text into view, the ...
Tooling
0
votes
2
replies
92
views
How to build a mobile barcode scanner that retrieves product prices from a custom API (similar to Scan2Info)?
I’m working on a system similar to Scan2Info, where users can scan a product barcode using their mobile phone camera and instantly retrieve product information such as price, name, and details from a ...
-2
votes
1
answer
72
views
Style property gets re-formatted when setting on HTML dom element [closed]
I am trying to set the top and left style properties on a div to position it at a screen location, but it's not working. No matter how I define the properties, they somehow get re-formatted to a ...
Advice
1
vote
3
replies
71
views
Common scenarios for memory leaks in Vanilla JavaScript and how to properly clean up?
I want to know what specifically causes memory leaks in Vanilla JavaScript.
Can you provide some examples of what code leads to a leak, and the correct way to handle or fix it to release memory?
Advice
0
votes
2
replies
41
views
Looking for feedback/collaboration on an educational web game for students (focus: engagement & learning design)
I’m currently building a browser-based educational game using HTML, CSS, and JavaScript, targeted at students in my country. The goal is to make learning feel less like a chore and more like something ...
Advice
0
votes
0
replies
21
views
Detect orphan pages and calculate PageRank-style link equity in TypeScript
I'm building an SEO audit tool where I need to analyze the internal link structure of a website. I have three specific problems:
I need to find orphan pages — pages that no other page links to, ...