#34 instanceof with array operands

open
nobody
None
5
2009-01-13
2009-01-13
Sebastián Gurin
No

hi . the following code gives different results in java and in javascript:

Object o1 = new String[]{"1,1", "1,2", "1,3"};
if((o1 instanceof Object[][])) {/* must be false cause Object[] is not an Object[][] */
System.out.println("bug1");
}

Discussion