pickelement = ["2123","149","3096","1471"];
var shiftlength = 4; //this is also dynamic
從上述我需要在循環拼接也重新初始化數組的長度的陣列,長度拼接將是動態的
for(var s = 0;s<shiftlength;s++){
nofofillres = Ext.ComponentQuery.query('[name=Resources'+s+']'[shiftreslength].value.length;
searchInput = pickelement .splice(nofofillres); // this is not working as expected
console.log(searchInput); // Each time same number of elements is coming
// I need an answer suppose if
nofofillres for 1st iteration is 1 and second is 1 and third is 1 and fourth is 1 Then
spliced element should be "2123"
spliced element should be "149"
spliced element should be "3096"
spliced element should be "1471"
and also each time when sliced pickelement should be reinitalzied as below
["149","3096","1471"]
["3096","1471"];
["1471"];
Please provide an answer m stuck with it
}
可以pleasse提供您預期的結果的原代碼? –
嗨,我的預期輸出應該在一個變量它應該得到拼接元素和其餘元素應該重新初始化並執行相同的循環 –
你可以寫你想要的輸出。或者只是舉一個例子,並顯示你想要的結果。 – Vipul