And adding to 'Logic Ali's brilliant code ...
Code:
<script type="text/javascript">
array1 = [ 1, 4, 2, 13, 5 ];
odds = array1.slice( 0 ).filter( function( elem ){ return elem % 2; } )
evens = array1.slice( 0 ).filter( function( elem ){ return elem%2==0; } )
alert( odds + '\n\n' + evens );
</script>