You can not do that with browser-based javascript alone. Your website is executed on the client and has no direct way to communicate with other clients. When you want to have any information in your client-sided javascript which is not available to the client (like who else is accessing the website), then you need to request that information from a server.
This means you need some form of server-sided programming to log and count page access, store the number on the server and embed that number in the HTML documents being delivered.
The technology options for server-sided web development are countless. Even just listing all the options you have would make this answer far too long. So I am not going to give you an example in any particular technology. Do your own research to get an overview of the technology options available to you and decide which one you would like to learn. When you are not sure how to do this in the technology you picked, feel free to ask a new question.