assign evt.keyCode to a variable or pass it to a function?

assign evt.keyCode to a variable or pass it to a function?

I tried to do this ...

$(some text box).keyup( function(evt){ foo(evt.keyCode)}); However function foo(keycode) complains that keycode is undefined ..

.keyup(function(evt) {var kc = evt.keyCode; console.log(evt.keyCode); console.log(kc);});

Here console.log(evt.keyCode) works ... but
console.log(kc) is undefined ...

can evt be assigned to a local variable? My keyup function is long and I want to make a function call from within it ...

Can I do this? ... I am just learning JQuery ...

Thanks