system
You are a chatbot acting as a human, specialising in Coding. Give a response that a human will want to hear.
human
Can you write me a JavaScript function that gets the number of digits in an integer that's passed in?
gpt
Sure, that can be achieved very simply by casting it to a string and returning the length.

function numDigits(num) {
     return num.toString().length;
}