I want to have an interactive map in an idlegame where you can click on a tile (See screenshot) and something should happen. I am trying to do so with an SVG and paths around the tile. Please tell me if there is a better way to implement something like this. To my problem: I have finally got my Map-Component
Send a message if there is a role Discord.js
Bot send a message if the User who clicked the reaction has the ROLE “ID” I decided to try this, but it didn’t work out ====Here is the main Code==== Answer You should check the role of the member who reacted (the member found in reaction.users.cache). reaction.users.cache returns a user, an…
It doesn’t print the names on screen with fetch call
I have to call the data from the given URL with fetch call. It should print the name of academy in and student names in on screen but when I click the button nothing happens. I know maybe its a huge code and it takes time but I would be grateful if someone could help me. Thank you in advance.
Get entire array of objects after mapping duplicates by a deep nested key
I have a huge nested array of objects and I want to filter and remove the duplicates, defined by the deep nested key uniqueId. With the following mapping I only get the values for the key uniqueId. But I need the entire array of objects m. JS Questions: How do I get the filtered array m? Is it possible within
Combine two array into one while getting the sum of instances in second array
I have two arrays. The first array is this: This is the second array: If id of arrayOne is equal to typeId of arrayTwo, then append arrayTwo into arrayOne and sum up the number of processing, approved and disapproved. This is my desiredArray: Answer You can first reduce the second array and then map it to the…
My first api request always fails after page load
I’m having a problem with my API request that always fails after page load. Don’t really know where Im wrong. Here’s my request and I call it when I interact with handleOpen function. ERROR: Answer It’s because your Ticker parameter is empty. When you create “stock”, clicke…
“Cannot use import statement outside a module” error when importing react-hook-mousetrap in Next.js
Trying out Next.js but I’m struggling with the following. Just tried to install react-hook-mousetrap and imported it like I normally would: This gives me the following error: I am not sure what this means? I then thought it might be a problem with Nextjs’s SSR, since my library enables hotkeys and…
javascript ondrag when pressing itself
Inside the div I have a set of p elements. I want to drag the selected element to the input Example: I want to transfer the text from the p element to the input when dragging, but in a multiple way, for all the p elements How, when dragging any of the multiple elements, get the text from the p
Horizontal scroll jquery-mousewheel library function errors (ex: this. on is not a function)
I am trying to create a horizontal scrolling website and I was following this tutorial which uses this library; however I get a “this.on is not a function” or a similar error where something is not a function. I have tried rotating my webpage but it just messes everything up (href anchors don̵…
How do I wait for the function to complete?
json/shortcuts.json file is: I’ve tried async and await as well as passing one of the functions as a callback. Nothing succeeded:( I think function works bad because of asynchrony. I just started learning of JS, so i am beginner and kindly ask for help! Thanks! Answer Because axios already have a callba…