Changes

Jump to navigation Jump to search
m
no edit summary
Line 45: Line 45:  
function indexinterpolate(obj,i) { return  (obj[i] != undefined) ? obj[i] : obj};  
 
function indexinterpolate(obj,i) { return  (obj[i] != undefined) ? obj[i] : obj};  
   −
// dive selects mymatrix.a.b.c.d from mymatrix array and 'a.b.c.d' as string
+
// dive selects matrix.a.b.c.d from the array called matrix and 'a.b.c.d' as string
 +
// if a.b.c.d does not exists, it returns the substructure until the substructure exists, if d does not exist, it returns matrix.a.b.c e.g.
 +
 
 
function dive(array, read){
 
function dive(array, read){
 
return read.split('.').reduce(indexinterpolate, array);
 
return read.split('.').reduce(indexinterpolate, array);
 
}
 
}
530

edits

Navigation menu