Skip to content

Tag: arrays

get the number of inputs given to a function js

Assume i have created a function function findInputGiven(){} and i called it somewhere below twice findInputGiven([1, 2], [3, 4]), findInputGiven([1, 2], [3, 4], [5, 6]). This function can be called with multiple inputs, i dont know how many inputs will be available in my findInputGiven function. How can i ge…

Javascript Array of Functions get auto executed

I need to make a sequence of Promises that are executed in a queue. They are dynamic so I need to put them in an array (I have found an article that explains how to). The problem is that my array of functions autoexecuted it self (version with a normal funciton): I don’t know why, an array of functions …

JS for loop loops once

My problem is that I am trying to iterate over an array several times, however, my for loop will only iterate over the array once (Or so it seems to me) which causes the outcome to be wrong. What I am trying to do is loop on this array: let arr = [“e5”, “b2”, “a1”, “c…