This is a function in the Modernizr.js. http://modernizr.github.com/Modernizr/annotatedsource.html#section-21
Function test_props accepts props which is an array, then iterates it using a for-in loop. My question is: since props is an array, it has a length property. And normal for loop is faster than for-in loop. Why using for-in loop?
function test_props( props, callback ) {
for ( var i in props ) {
if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], modElem ) ) ) {
return true;
}
}
}