Skip to content

Category: Questions

Create another data for single data in array

I’m doing a matchmaking system where 2 players with the same level will be matched (Joined in 1 array). My target is how can I make the player who has no match to have a 2nd data in array? The example I provided is when a player who doesn’t have a match, there should be another data that produces …

is it possible to combine these two functions into one?

I have two functions that are basically identical. The first function gets passed a mouse event where event.target is the input type=’checkbox’ the second function gets passed the input type=’checkbox’ is there a way to rewrite these into one function? Answer The only part of these two…

How to convert an integer with n decimal places to a float

I have this integer 7839486009458047182 I have a variable that tells me this number should have n decimal places (In this case 18) How can I change it to 7.839486009458047182 (If React has this as a method I could use in a template that’s even better!) Answer If you’re not too bothered about preci…