2,525,024 questions
1
vote
1
answer
28
views
"Uncaught TypeError: Cannot read properties of undefined" when accessing nested object in JavaScript React component
Problem:
I am trying to display a user's address from a nested user object in my React component. When the component first loads, I get an Uncaught TypeError: Cannot read properties of undefined (...
-3
votes
1
answer
79
views
How do I debug a type error in web development? [closed]
I am learning web development and sometimes I get type errors when running my project. I understand that a type error usually means the program is trying to use a value in the wrong way, but I’m not ...
-3
votes
1
answer
37
views
Converting a PHP object array to a JavaScript object array
First, I retrieve the data from the database using PHP oop called it $details. $details contain several object array totally about 7. Each object array has a PHP object fields are service_idno, ...
-3
votes
2
answers
83
views
How to do hierarchical queries with arrays
I have an JavaScript array like this:
let myArray = [
{ name: 'Alice', children: ['Bob', 'Bill'] },
{ name: 'Bob', children: 'Cindy' },
{ name: 'Bill', children: [] },
{ name: 'Cindy', ...
Best practices
1
vote
4
replies
64
views
How can one create mini quiz app project with pure vanilla JavaScript. i'm a learner, after the structuring the html / css i couldn't continue
How can i create a mini quiz app with pure vanilla JavaScript which takes questions and presents options which include the correct answer and output the scores with a next button which switches the ...
Best practices
0
votes
1
replies
48
views
How do I weight certain array comparisons more heavily than others when matching input across an answer key?
I'm making a quiz-type program and I have 8 preset answer keys that each have an array of 15 binary values. User answers the same 15 questions, I compare their array against all 8 and then return the ...
Best practices
2
votes
2
replies
43
views
Representing wiring and measuring currents in a JavaScript three-phase motor circuit simulator
I am building a browser-based electrical training simulator in JavaScript. The goal is to simulate industrial control circuits (contactors, overloads, push buttons, and three-phase motors) and allow ...
-9
votes
0
answers
142
views
Remove special characters from a string except emojis [closed]
I want to remove all special characters from a string except emojis.
var stringWithEmoji = "test 😎";
var cleanedString = stringWithEmoji.replace(/[^a-zA-Z0-9\s]/g, '');
The above replace ...
-1
votes
0
answers
48
views
How to implement deterministic conflict resolution for out of order JSON patch streams in a real time collaborative editor [closed]
I am building a real time collaborative editor in JavaScript where multiple clients edit a shared JSON document. Updates are sent over WebSockets as JSON Patch style operations.
Constraints:
Clients ...
Advice
0
votes
0
replies
37
views
Embed font + LICENSE in a third-party library using current JavaScript bundlers
I usually use @fontsource/{font} NPM packages for open-source fonts, but it happens one open-source font I like to use for code sections isn't that popular and isn't anywhere on NPM. I need to embed ...
4
votes
3
answers
147
views
HTML date element has empty space when disabled
Problem:
I have an
<input type="date"/>
element, and it looks like this:
normal date selector
as you see there is a "calendar" icon which can be used to select a date.
but ...
1
vote
1
answer
63
views
cargo site—slideshow gallery with thumbnail index
I'm trying to customise my site on Cargo, and I'm hoping to have a slideshow gallery that also has a thumbnail index of the images below it.
Right now I have just created two galleries of the same ...
Best practices
0
votes
2
replies
87
views
fetching from an API in react
so to fetch from an API in react we can either use the useEffect(), or a combination of useEffect() and useCallback(), but there is a very annoying problem that I see most of the time where we get ...
-3
votes
0
answers
96
views
How to read in local file in react [duplicate]
This should be simpler. I am writing a demo of some proposed solution. I need to initialize a react component (a react-quill editor if it matters) with the contents of a file. In our final solution,...
Advice
1
vote
15
replies
164
views
Which languages are the best ones to opt for if the final goal is full stack and perhaps a switch into the ML and AI world
I am looking for languages that serve as the best foundational languages I would need to step into full stack development, and use that base and experience to maybe switch to ML, AI, Data Science, ...