Does the
const
string
var x = "asdf";
const constantX = x;
alert("before mutation: " + constantX);
x = "mutated"
alert("after mutation: " + constantX);
before mutation: asdf
after mutation: asdf
Yes, it does, but it is not been standardized and is not supported in all browsers.
See this MDN article on the const
keyword for details and compatability.