Using the keyword let
to declare constants is not a general convention. The keyword let
is used that way in Swift, Rust and Haskell, but in Javascript it denotes a regular variable (just one with a special scope).
As for where the use of let
to declare variables come from, it's a very old tradition for mathematical proofs:
(Source, due to popular demand: https://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/Theorems.html)