Category "javascript"

Handle movement after collision is detected

I'm making a small platformer in js and I'm having trouble with the collisions. Unfortunately it seems that 90% of the info online is detecting the collisions,

How do I check that a number is float or integer?

How to find that a number is float or integer? 1.25 --> float 1 --> integer 0 --> integer 0.25 --> float

Why my scrollMagic is not working properly?

So basically I have problem wherein I try to make animation in my scroll animation using scrollMagic..My codes are written in reactjs but I don't know why it is

My implementation of Breadth First Search with forEach doesn't work

Here is my code inside a BinarySearchTree class. I don't know if it is because of the behaviour of forEach, or because somewhere in my code is wrong. class Bina

Save react-pdf rendered file to state for sending it to server?

im using react-pdf library i managed to save file localy but now i would also need to save it on server since i am required to do a history display of all the f

Is it possible to use amCharts5: Simple Pie Chart, but not with percentages?

I started using this library, and I liked it. I was wondering if anyone had the need for instead of showing the data in percentage, to show the real data withou

Connect to MetaMask via chrome extension

I am making a chrome extension that requires MetaMask authentication. I started developing it as a web application, but as a chrome extension, it doesn't detect

Cannot destructure property 'name' of 'client' as it is undefined

ans In your component where you want to destructure, destructure like this. const {name} = client;

One component affecting another in reactjs

Every url loads three main components: Left panel, center and right panel. In right panel, we have a button which returns a sub-component CreateForm inside the

How to find documents based on the result of a function mongoose

So I have two schemas user and driver they both have latitude and longitude attributes. At some point I want to query the database for nearby drivers, I will be

How to check if a message author has a role?

I am trying to code a bot for a game idea my friends and I have. The command I'm working on is the score adjuster. Obviously though, I only want moderators to h

How to view js heap in Chromium 101.0.4951.67

How to view heap objects in Chromium 101.0.4951.67? The profile tab has been removed and replaced with the 'Javascript Profiler' tab that only records cpu. I ca

Not getting what's happening in the JavaScript script code below

async function async1(){ console.log(1) await async2() console.log(2) } async function async2(){ console.log(3) } console.log(4) setTimeout(funct

How to open a link in default browser in an electron app

I want to know how to open a web link in the default browser when clicked on a button in an electron app. Can anyone help me?

Upload speed testing function behaves differently when I call it from electron GUI

I've wrote a simple function to measure the upload speed of my network, which when run inside vscode terminal behaves just fine and displays the expected result

GMAIL: How to open a existing email in new window if I know its id?

Shortly: How to open email in gmail if I know its id in new window? Greetings. I get from GMAIL API the id of needed email. I want it to open in separate window

Send the selected option to the backend

I have a select menu (with three options) along with a search bar. All I want is to save the selected option and the searched term and send them to the back-end

NextJS with Serverless Mysql ServersideProps - fs error

I'm trying to build an app in nextjs and I've stumbled upon some issues. I'd like to do a query call inside my getServerSideProps() but I get the error: error -

How do you create a drop-menu with images next to each option in JS?

I looked up several tutorials on how to get the image next to the title, however, they are for small datasets that are manually inputted. Having almost 3,000 ro

I am seeing following error while trying to add firebase analytics

I have linked firebase analytics to the firebase project recently but I am getting the following error in my console and nothing is visible in the firebase anal