Home > Back-end >  Who can know that the js code below
Who can know that the js code below

Time:11-29

 function SomeFunction1 (toList, tnIndex tnRelativePos) {
Var lnDestIndex=tnIndex + tnRelativePos;
Var loOption;
If (tnRelativePos==0) return;
If (lnDestIndex>=0 & amp; & LnDestIndexLoOption=toList [tnIndex];
If (lnDestIndexFor (var lnIndex=tnIndex; LnIndex> LnDestIndex; LnIndex -)
ToList [lnIndex]=toList [lnIndex - 1);
} else {
For (var lnIndex=tnIndex; LnIndexToList [lnIndex]=toList [lnIndex + 1];
}
ToList [lnDestIndex]=loOption;
}
}

CodePudding user response:

It looks as if is named column data

CodePudding user response:

Js array position transformation

CodePudding user response:

The
refer to the original poster song song KING reply:
 function SomeFunction1 (toList, tnIndex, tnRelativePos) {
Var lnDestIndex=tnIndex + tnRelativePos;
Var loOption;
If (tnRelativePos==0) return;
If (lnDestIndex>=0 & amp; & LnDestIndexLoOption=toList [tnIndex];
If (lnDestIndexFor (var lnIndex=tnIndex; LnIndex> LnDestIndex; LnIndex -)
ToList [lnIndex]=toList [lnIndex - 1);
} else {
For (var lnIndex=tnIndex; LnIndexToList [lnIndex]=toList [lnIndex + 1];
}
ToList [lnDestIndex]=loOption;
}
}



Method parameters 1 array, 2 element coordinate of the need to move after 3 mobile location,

Is tnIndex coordinate element in the array, mobile tnRelativePos new coordinates, negative forward, positive backward-shift, other elements the order unchanged,



  • Related