I'm writing a javascript who is supposed to just print on a raw web-page and I'm finding some formatting problems. I would like to know if there's a way to do something like printf("%4d",num) in Javascript, because I always need to print a number considering it with 4 digits. It would be something like that:
Year
1
Instead of:
Year
1