I want to define a function like below and use it inside Jquery $(document).ready;
function pad2(number) {
return (number < 10 ? '0' : '') + number
}
I am not sure I am doing it right here. I don't want to bind the function to window object. what kind of way should I follow here to do the following thing right;
$(function(){
alert(pad2(eval("10")));
});
function pad2(number) {
return (number < 10 ? '0' : '') + number
}