"var" in Chinese (Simplified)
var(编程,变量声明)
Definition
“var”是某些编程语言(如JavaScript)中的关键字,用来声明变量,变量是可以在程序运行过程中改变的数据存储位置。
Usage Notes (Chinese (Simplified))
“var”只在编程和计算机技术语境中使用,尤其是在旧版JavaScript代码里。现代代码推荐用“let”或“const”。日常生活中不使用这个词。
Examples
We use var to declare a variable in JavaScript.
我们用**var**在 JavaScript 中声明变量。
The var keyword lets us store data.
**var** 关键字可以让我们存储数据。
With var, you can create variables that can change value.
使用**var**可以创建值会变化的变量。
If you see var in code, it means the value might change later.
如果你在代码里看到**var**,说明这个值以后可能会变。
Many programmers now avoid var and choose 'let' or 'const' instead.
现在很多程序员不再用**var**,而是更喜欢用“let”或“const”。
Old tutorials still teach var, so don't be surprised if you see it.
老教程还会教**var**,所以看到它别奇怪。