From e1e6b6fa41341b85981f7d787cce6480f9ba8544 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+nikitarevenco@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:05:43 +0100 Subject: [PATCH] feat: improve wording about var Co-authored-by: Alex Younger <61510135+fortypercenttitanium@users.noreply.github.com> --- foundations/javascript_basics/variables_and_operators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundations/javascript_basics/variables_and_operators.md b/foundations/javascript_basics/variables_and_operators.md index bcd9cd32358..d86000081c6 100644 --- a/foundations/javascript_basics/variables_and_operators.md +++ b/foundations/javascript_basics/variables_and_operators.md @@ -110,7 +110,7 @@ So in summary, there are two ways to declare a variable: - `let`, which we can re-assign. - `const` which we **can't** re-assign and will throw an error if we try. -There is also a third way - using `var`. It's similar to `let`, but it is the old way and should **not** be used. However, you will likely come across code which uses `var`, so it is useful to know that it exists. Do not worry too much about it for now. +There is also a third way, `var`, which was the original way variables were declared in JavaScript. `var` is similar to `let` in that variables assigned this way can be reassigned, but it has other quirks that were cleared up when the language introduced `let` and `const`. By and large, it is not used anymore. However, you will likely come across code which uses `var` at some point, so it is useful to know that it exists. ### Numbers