Hey there! What language you use will depend to a large extent on the engine you choose. Unity, for example, supports javascript and C# natively. Personally, I would choose C# over javascript, but I understand that people have their preferences and working within what you already know has its benefits. But to answer your question more directly, yes, javascript can be a viable option if your game engine natively supports it.
with a little digging, it seems unity users are discouraged from using js in lieu of c# -- their js-like unityscript is being removed.
but! I still want to try and get something started using javascript as the foundation, as it's a language I work with everyday. are there any options for frameworks, engines, etc that aren't unity?
(one day, of course, I'd love to learn c# for software development, but I'm just not there yet)