main() function in JavaScript?

前端 未结 3 1577
有刺的猬
有刺的猬 2021-01-03 19:26

I have seen a main() function in some JavaScript files I have come across. Is it the same main function as you use in other languages such as C#, C++?? If you p

相关标签:
3条回答
  • 2021-01-03 20:04

    No, main is not the same in JavaScript as in C languages. It's just another function, but the original programmer is probably using the name as a convention to indicate where the code should start running.

    0 讨论(0)
  • 2021-01-03 20:14

    "Main" function has nothing different then any other function (Its just a name). It will run when called and not automatically.

    0 讨论(0)
  • 2021-01-03 20:23

    It is just a name given to a function, there isn't such a thing as C "main" in javascript.

    0 讨论(0)
提交回复
热议问题