Differences between const, let, var, and let mut in the 20 most popular programming languages

Languageconstletvarlet mut
CImmutable variableMutable variableMutable variableNot supported
JavaImmutable variableMutable variableMutable variableNot supported
PythonImmutable variableMutable variableNot supportedNot supported
JavaScriptImmutable variableMutable variableMutable variableNot supported
PHPImmutable variableMutable variableNot supportedNot supported
RubyImmutable variableMutable variableNot supportedNot supported
SwiftImmutable variableMutable variableNot supportedMutable variable
KotlinImmutable variableMutable variableNot supportedNot supported
TypeScriptImmutable variableMutable variableMutable variableNot supported
C++Immutable variableMutable variableMutable variableMutable variable
C#Immutable variableMutable variableMutable variableNot supported
GoImmutable variableMutable variableNot supportedNot supported
RImmutable variableMutable variableNot supportedNot supported
MATLABImmutable variableMutable variableNot supportedNot supported
Objective-CImmutable variableMutable variableNot supportedNot supported
PerlImmutable variableMutable variableNot supportedNot supported
ScalaImmutable variableMutable variableNot supportedMutable variable
ShellImmutable variableMutable variableNot supportedNot supported
SQLNot supportedNot supportedNot supportedNot supported
LuaImmutable variableMutable variableNot supportedNot supported

Note that this table is a generalization and that some languages may have slightly different semantics for these keywords. Also, some languages may not support all of these keywords or may use alternative syntax for variable declaration.