If we created a function and we need a const variable inside the function, which means we want a variable that will not be updated in any case. Here if we will declare a var variable or let variable, then it can be updated, but if we declare a const variable, it will not be updated in any case and will work fine with our function.
We can declare var x = 50; Later we can assign another value by written var x = 23;
We can declare let x = 50; Later we can assign another value by written x = 23;
We can declare const x = 50; In this case we won't be able to update the value;