I’m trying to create a function that will create some combinations .the combinations of arrays i want to create are stored at the “ev0s” variable …so far i know that my mistake is really basic,…at the for loops ,.ive been always having a hard time trying to understand it…any help is really welcome and also the explanations, thanks community.
here is my code so far:
//Declaring variables values
var apers = [“f/1”, “f/1.4”, “f/2”, “f/2.8”, “f/4”, “f/5.6”, “f/8”, “f/11”, “f/16”,
“f/22”, “f/32”, “f/44”, “f/64”, “f/88”];
var shrs = [“128m”, “64m”, “32m”, “16m”, “8m”, “4m”, “2m”, “60s”, “30s”, “15s”, “8s”,
“4s”, “2s”, “1s”, “1/2s”,“1/4th”, “1/8th”, “1/15th”, “1/30th”, “1/60th”,
“1/125th”, “1/500th”, “1/1000th”, “1/2000th”, “1/4000th”, “1/8000th”];
var isos = [“50”, “100”, “200”,“400”, “800”, “1600”, “3200”, “6400”, “12800”, “25600”, “51200”,
“102400”, “204800”, “409600”, “819200”];
var evs = ["-15", “-14”, “-13”, “-12”, “-11”, “-10”, “-9”, “-8”, “-7”, “-6”, “-5”, “-4”,
"-3", “-2”, “-1”, “0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “11”,
“12”, “13”, “14”, “15”, “16”, “17”, “18”, “19”, “20”, “21”, “22”, “23”, “24”,
“25”, “26”, “27”, “28”, “29”, “30”, “31”, “32”, “33”, “34”,“35”, “36”, “37”,
“38”];
//Combinations of Exposure Value 0
var ev0s = [[apers[0] + shrs[13] + isos[1]], [apers[1] + shrs[12] + isos[1]],
[apers[2] + shrs[11] + isos[1]], [apers[3] + shrs[10] + isos[1]],
[apers[4] + shrs[9] + isos[1]], [apers[5] + shrs[8] + isos[1]],
[apers[6] + shrs[7] + isos[1]], [apers[7] + shrs[6] + isos[1]],
[apers[8] + shrs[5] + isos[1]], [apers[9] + shrs[4] + isos[1]],
[apers[10] + shrs[3] + isos[1]], [apers[11] + shrs[2] + isos[1]],
[apers[12] + shrs[1] + isos[1]], [apers[13] + shrs[0] + isos[1]]];
//instead of writing all of the combinations of exposure value 0, the intention is
// create them with some function
function eVConst(arr){
var ev0 = [];
for(var a = 0; a < arr.length; a++){
for(var s = 0; s < arr.length; s--){
for(var i = 0; i < arr.length; ){
while(i === isos[1]){
ev0 += arr[a][s][i];
}
}
}
}
return ev0;
}
eVConst([apers[0], shrs[13], isos[1]]);