Otherwise
return 0 ; } function count ( a , c ) { count = 0 ; for ( var i = 0 ; i < a . length ; i ++ ) if ( a [ i ] == c ) count ++ ; return count ; } function swap ( s1 , index1 , s2 , index2 ) { var c = s1 [ index1 ] ; s1 [ index1 ] = s2 [ index2 ] ; s2 [ index2 ] = c ; }