For example
const array1 = [Male, Female];
const array2 = [18-20];
const array3 = [Self Employed, Part Time, Full Time];
output will be
First Array:- [Male, 18-20, Self Employed];
Second Array:- [Male, 18-20, Part Time];
Third Array:- [Male, 18-20, Full Time];
Fourth Array:- [Female, 18-20, Self Employed];
Fifth Array:- [Female, 18-20, Part Time];
Sixeth Array:- [Female, 18-20, Full Time];
3
Answers
We can do this by getting random item from each array and adding them to a new array. we are using the pick function get a random item each item.
then we are using the for loop to create the final arrays.
To pick one item from each of three arrays and create a new array in JavaScript, you can use a combination of array manipulation methods like Math.random() and push(). Here’s an example of how you can achieve this:
for know more visit my website
https://askmequora.com/posts/we-have-3-array-and-how-pick-1-item-from-each-array-and-push-a-new-array-using-javascript
I can use foreach loop and array by array store the answer in output array