What would be the best way to call two arrays (identical structure, just different values)?


what best way incorporate second array (identical structure, different values)?

so entering value in form field, , depending on value, either call first or second array use in calculation.

would best define multiple arrays in document level javascript?

your question not clear, sure, can define many arrays want in doc-level.

if arrays have same structure , length can iterate 1 of them , use index of item you're interested in other. example:

 

var array1 = ["a", "b", "c", "d"];

var array2 = [65, 66, 67, 68];

 

for (var i=0; i<array1.length; i++) {

     if (array1[i]=="b") app.alert("the number matching b is: " + array2[i]);

}



More discussions in JavaScript


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop