Unlike var
, when you use let
, a variable with the same name can only be declared once.
A keyword called let
was introduced in ES6, a major update to JavaScript, to solve this potential issue with the var
keyword.
let catName = "Oliver";
let catSound = "Meow!";
Was this article helpful?
YesNo