I am new to react js. I currently have a web page with the a simple DateTimePicker (the datetimepicker i am using is from react-widgets/lib/). So the idea is I have a variable called myvalue. If it is NOT null, I set the defaultValue of DateTimePicker to myvalue, otherwise – I leave DateTimePicker’…
Tag: javascript
Typescript data filtering on nested array based on another array
Im new to TS I have an array of data that looks like this I want to loop over a the data in the “industries” in the AllJobs array and check if any of those vales match any of the values in desiredSkills. If no matching values, filter out that object. I don’t know if im doing this right at
How can I keep track of game data that is changing without using global variables? [webpack]
I had a simple Rock Paper Scissors game where I used global variables to keep track of game data like player score, computer score, the state of the game (ongoing = true/false), etc. I recently learned how to use webpack so I bundled up my code into modules to practice in this format, and now I’m unable…
Why does using a String.split(regex) include an empty string at the beginning of resulting array?
I have a string data that is a numbered list (e.g. “1.Line 1n2. Line 2nLine 2 Continuedn3. Line 3”) I tried making a regex that splits the string into [“Line 1n”, “Line 2nLine 2 Continuedn”, “Line 3”] and I made this regex const reg = /d+./gm. When I use the fol…
Character Teleporting to side of screen when trying to move
I’m very new to HTML, CSS, and JavaScript. My darthVader character keeps on teleporting to the side of the screen any time I try to do any movement. I think this might be a problem with my CSS. Also I am open to any and all suggestions for changes for this project. Whether it is efficiency, layout, or a…
Eval a function definition vs. variable function definition
If we define a function f() { … } in eval(…), why isn’t it available for the rest of the code, such as #button3’s onclick? As a comparison, if we define the function as f = () => { … };, then it is available for #button3’s onclick. Why this difference, which seems a litt…
Nested Navigation in React Native not compiling
I’m new to nested navigation. I have tried to follow the principles here – however I am getting the error Couldn’t find a navigation object. Is your component inside NavigationContainer? I have brought the ‘Screens’ into the main App.js for ease of debugging and sharing code. Bel…
Using React packages in Astro
So I’ve started building a portfolio site for myself, gone with Astro as it’s now the cool new thing, so thought why not, was going to use Gatsby but this seems like the more performant solution and you have a lot of freedom with it (not tied in to a GQL CMS). As I understand it, Astro is a soluti…
How to programmatically reconnect to server when there is no working connection to the server?
Is there a function/method in socket.io to trigger a ping-pong event from the client-side? I want to ensure that before the client emits an event that it has a working connection with the server. For example, when the client goes into standby or sleep mode with the web application open in the background, the …
Difficulties to make another route expressJS
I am doing a site as of my studies. The technology being free, I decided to code with nodejs/Express. For my first route /home, everything went well. But I can’t create others. Yet I thought I understood the system well. It would bother me if it was due to a silly error because I have been on this probl…