Skip to content
Advertisement

Tag: arrays

Use an object attribute to create an array with it [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 9 months ago. Improve this question Hi guys i want to do something “simple” but not for me, I have this array And i want to

Combine variable value and string to use in another variable name

I need to combine a variable value and a string value into one. The problem is in the function. Iam trying to pull the name of a resource in the “resources” variable and this needs to be combine with “Amount” at the end in a new variable called “resourceName”. For example “FoodAmount” but it ends up giving undefined back when

Finding the symmetric difference in a loop

I need to write a function that can take an indefinite number of arrays containing integer numbers and it should return 1 array which is the accumulative symmetrical difference between those arrays. Only two arrays are compared at a time. So [1, 2, 3], [3, 4, 2], [1, 5, 3] would first result in [1, 4], (comparing the first two

Sudoku puzzle test

Trying to write a script that check if Sudoku puzzle is correctly solved. I tried to check every value using 2 cycles and test method and replace value to “0” if test return true but script does not replace all the values and I don’t understand why. Could you please explain why script replaces some values, but others does not?

Get data from array based on time intervals [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 9 months ago. This post was edited and submitted for review 9 months ago and failed to reopen the

How to combine 2 arrays in a way that 1st element of array1 and 1st element of array2 and so on form a new array

I have 2 arrays. The first contains the years like [2021,2020,2019,2018,2017] and the second contains number of occurrence like [2,3,1,3,3] I want the new array to look like this [[2021,2],[2020,3],[2019,1],[2018,3],[2017,3]] How to do this? Please help! Thank you in advance. UPDATE: I tried doing this and it works fine but the new array looks like this How to make it

Highmaps js, on Hover display additional data

I’m working with the map of Paraguay. I added an input select to select different years and the maps changes according to my selection. The thing is, my data always comes in this format: With the help of this function I’m able to switch the values for the map according to selection and change the array to a format that

Advertisement