The question states: Write a function canSum(targetSum, numbers) that takes in a targetSum and an array of numbers as arguments. The function should return a boolean indicating whether or not it is possible to generate the targetSum using numbers from the array. You may use an element of an array as many time…
Category: Questions
How can I prevent click handler action on the whitespace around an SVG path?
I have this image here which is SVG format, when the user clicks this image some action happens. One problem there, this image has some white empty space around it that can’t be removed because it’s not a quadrilateral. What I need is when the user clicks this empty space around the image don̵…
Difference between defineProps() and defineProps({ }) syntax?
Actually, I read someone code and they define props using defineProps<({})>() syntax and I research about it and didn’t find anything which helps me to understand about this syntax. How I Define Props How other developer define props I want to know what’s the difference between both syntax. …
How to use map function inside a map function REACT wordpress
i’m creating a wordpress plugin with React – haven’t really ever used React before this, so I’m probably misunderstanding something crucial but this is what I’m trying to achieve: You have a button that creates a question for a quiz and then to every button you can add multiple s…
Change collision width and height of individual tiles in a tilemap
I’m working on a game in Phaser 3, and need to be able to change the collision width and height of the wall tiles to something other than the width of the images, but I can’t find anything that doesn’t involve Tiled, which I can’t use as it’s a procedurally generated game. I foun…
Alert windows for second function not popping up
I’m working on an assignment where I have to write a basic program that generates a random password based on certain criteria. I have written the following snippet of code to receive input from the user regarding the minimum and maximum values of the desired password length. ` ` The prompts in the getPa…
react – how to add multiple lists in options with condition to show one of the lists based on the state?
I want to load multiple lists in options. I want to show list based on the country selected. I can’t seem to figure out either. First I tried to load all the lists and put them in <option> This didn’t work. While I see that the list laods, when I try to type anything from GYDATA it doesnR…
How to conditionally merge an array in Javascript?
I have a problem, I don’t know how to solve it, I will try not to give too much context and focus on the problem A worker marks hours every day in his work, this is stored in the “dayli_data” array when the worker did not perform his hours then the “time_off” array is returned I …
reuse same value of a function on a vue template
I have a situation that repeats a lot when im trying to get a value on the template from a function, this function recieves parameters from the template (for example the index of a v-for) and returns a result that is printed on the template, the problem is that I need to do this operations twice, and since th…
How to prevent players from updating their marker on Tic Tac Toe
I’m working on a Tic Tac Toe project and having trouble with a certain task. Build the functions that allow players to add marks to a specific spot on the board, and then tie it to the DOM, letting players click on the gameboard to place their marker. Don’t forget the logic that keeps players from playi…