0
self.scope.savesectioneditmain = [self.scope.savesection2details,
self.scope.editsection2,
self.scope.savesection1details,
self.scope.editsection1];
根據上面的代碼,我想檢查所有數組值等於true
值。如何檢查所有數組等於角js中的某個值?
if($.inArray(true, self.scope.savesectioneditmain) == 0)
我已經試過$inArray
,但$inArray
只檢查一個條件,但我要檢查所有的數組值應等於true
。
你想檢查實際數組中的屬性?它是否包含一些對象的數組?或一些字符串?我一直在困惑。 – digit
字符串true或false,我的數組包含true或false。 –