How can I adapt this javascript to return a postcode less the last 2 characters? : <pre><code>function() {
    var address =  $("#postcode").val();
    var postcode = address.split(' ');
    postcode = "Postcode:"+postcode[(postcode.length-2)];
    return postcode;
}
</code></pre>

<p>This js pulls a postcode value from an online form when the user runs a query. I need to know how I get it to deliver the postcode less the last 2 characters. for example, SP10 2RB needs to return SP102.</p>
