It doesn’t work differently.
It’s a matter of convention (but it will work well even if you don’t follow the convention).
the convention for JS is that variable starts with a lowercase letter and written as camel case ( let myFirstVar = val; ).
Classes and constructers start with an uppercase letter ( class MyFirstClass{} )
and there’s also a common convection to use all caps for constants ( const MY_CONST = 5; )
The latter is what you were asking about.