Javascript/jQuery - IF in array and IF value:pair

VBc0d3rnoob

New Member
I have a numeric value:pair list as follows:\[code\]var level1 = {0:1,1:0,2:0,3:0,4:0,5:0,6:0,1:1,2:1,3:1,4:1,5:1};\[/code\]...if I rewrite it into an array like this (which will lose it's numeric format):\[code\]var level1 = ['0:1','1:0','2:0','3:0','4:0','5:0','6:0','1:1','2:1','3:1','4:1','5:1'];\[/code\]...I can check if the value is such array exist by:\[code\]if($.inArray(value, level1) > -1){ // let's party }\[/code\]How would I check if the numeric value:pair exists for the value:pair list above?
 
Back
Top