0

I found a code on the internet how to get length of a number in javascript.

var month = '10';

//(1)
 month.toString.length    
// =>  return 1
//(2)
 month.toString().length   
// =>  return 2

I knew (2) is right. But I couldn't find what's difference between (1), (2).

Can you tell me the difference between (1) and (2)?

YOUNG MIN CHO
  • 253
  • 1
  • 3
  • 13

0 Answers0