Skip to main content

All Questions

Tagged with
0 votes
1 answer
52 views

How to loop through an array?

How do I loop through an array? The idea is to go to the Names worksheet, Where I have a list of users Initials and names in a list. Create 2 arrays that record the initial and name of each person. ...
One foot in the Grave's user avatar
-1 votes
2 answers
33 views

Extracting values from array and adding them to new elements

I've got some code which loops through an array of products, it records new categories found and also how many times a category is found: const categoriesFound = (catArray) => { let categories = {...
Chobbit's user avatar
  • 493
-5 votes
0 answers
43 views

Appending to an Array in Bash [closed]

So I am currently working on some practice exercises for learning Bash Scripting, one of which is a brute forced way of doing calculating up to the nth Fibonacci sequence where n is an input from the ...
user26396173's user avatar
2 votes
1 answer
53 views

javascript setting a .map() range and update the range later

I'm building an app with React & JS which returns products from a json list inside a component, the array is outputted on the app using a .map() array. I'm also limiting the amount to return ...
Chobbit's user avatar
  • 493
1 vote
5 answers
79 views

In C#, I'm trying to iterate strings in single loop, how?

I'm trying to achieve this output: LOWEST LOW MEDIUM HIGH HIGHEST HIGHEST HIGH MEDIUM LOW LOWEST I know there are many ways to do it, but I'm trying it in single loop, is it achievable? My code is ...
Norvz's user avatar
  • 27
0 votes
0 answers
55 views

Push entries into a result array from deepest nested loop, but also push an entry when deepest loop is not reached

I am creating an array for an order to then pass this data to stripe, the array has multiple forEach clauses. The issue I am facing is, if the order item(s) does not have menu_options it is not ...
George Richardson's user avatar
-3 votes
1 answer
64 views

Javascript Object Array, Iterate over only one object

I have a javascript array object. I want to find the result of a single array. The following code does what I want but always iterates over the whole array. How can I achieve the same on just one ...
London28's user avatar
  • 101
0 votes
2 answers
45 views

Filter array of object with another array of objects boolean property

i have dropdown values at frontend as follows. You can see the first 2 values Mar and May are checked based off the checked property in dropdownValues below. let dropdownValues = [ {key: 'Mar', ...
Aren Trot's user avatar
  • 473
-1 votes
1 answer
40 views

How to write values into empty array from a loop dedicated to another function in Javascript?

I am doing a random sort of values according to the Fisher Yates method, and to explore the inside of this process I tried to out the random numbers (arsam1 is the number fixed set, iValue1 and ...
Adam Givon's user avatar
0 votes
0 answers
50 views

printf in assembly NASM x86 print only once of the array in the loop

Calling printf function inside my x86 code, outputs only the first number in the array and stops working even if I remove the call exit. It prints out the first element in the array infinity extern ...
MR_Dalton's user avatar
1 vote
1 answer
30 views

How to create vector elements in pairs in a FOR loop in OpenSCAD

My aim is to create 2D vector elements in pairs, using a FOR loop. Consider the following example (not my real example - just something simplified to describe the problem): step1 = [ for (i=[1:5])...
Chris's user avatar
  • 13
-1 votes
1 answer
42 views

How do I loop through the containers so that the window alerts don't pop-up if at least one input field is filled? Same with radios

I managed to make an infinite loop through the containers which have different temperature elements, but I have a problem with the input fields as well as radio buttons. What I want is that if one ...
Dejan's user avatar
  • 5
-1 votes
1 answer
64 views

What effect does the placement of the reference symbol (ampersand) have in a simple loop?

I just started learning rust and I am confused about how the ampersand placement affects the program in the following examples. I understand that '&' indicates a reference to a variable, but I'm ...
Nack's user avatar
  • 1
1 vote
3 answers
66 views

Bash: How to get value from named key in multi-dimensional array

I get a "bad substitution" error when trying to get a named key from a dynamically-referenced array. GNU Bash version 4.1.2(2) WORKS: declare -rA DBONE=([system_name]='ABC' [dbname]='...
Genki's user avatar
  • 460
1 vote
5 answers
90 views

javascript function looping array

Why can't I get the output I want, I tried various ways but it doesn't work, where is it wrong? Give me a clue so I can learn. let laptop = ["asus", "lenovo", "acer", &...
arhrzk's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
779