Strict typing in Javascript function arguments