Why in eSignal EFS, Array.splice() does not work as expected?
For example, I expect the following script would print out
new Array.length = 12
newArray = 1,2,3,4,*,5,6,7,8,9,10
However, it seems newArray becomes empty after calling splice() to insert elements. Is it because splice() is not supported although it is listed in EFS2 developer's reference?
- Clearpicks
function main()
{
if ( getCurrentBarIndex() == -2 ) {
myArray=[1,2,3,4,5,6,7,8,9,10];
newArray = myArray.splice(5,0, '*');
newArray = myArray.splice(4,0, '*');
debugPrintln("newArray.length = " + newArray.length);
debugPrintln("newArray = " + newArray);
}
}
For example, I expect the following script would print out
new Array.length = 12
newArray = 1,2,3,4,*,5,6,7,8,9,10
However, it seems newArray becomes empty after calling splice() to insert elements. Is it because splice() is not supported although it is listed in EFS2 developer's reference?
- Clearpicks
function main()
{
if ( getCurrentBarIndex() == -2 ) {
myArray=[1,2,3,4,5,6,7,8,9,10];
newArray = myArray.splice(5,0, '*');
newArray = myArray.splice(4,0, '*');
debugPrintln("newArray.length = " + newArray.length);
debugPrintln("newArray = " + newArray);
}
}
Comment