How to use const function in java script

At the beginning of the of ES6 i read that const functions must be in upper case, right but as i go a step a head i notice that along the challenges there are other const function that go against the that concept can someone kindly explain to me why that is so.

its not a requirement for a const to be in uppercase its just common practice to use uppercase so that you and other programmers will know that its a fixed value.

2 Likes

There is no specific rule for const variables are in upper case. For more info you can visit https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const

2 Likes

It’s global constants that are usually spelled in all caps. Local variables that are const (which should be pretty much all your variables) should follow the naming conventions of any other local variable.

1 Like