编程中“let”变量的语言意义 [英] linguistic meaning of 'let' variable in programming

查看:911
本文介绍了编程中“let”变量的语言意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我是一个JavaScript程序员,新版本的javascript(ES6)有一个新的关键字声明变量: let ,在旧的 var

So, I'm a javascript programmer and the new version of javascript (ES6) has a new keyword for declaring variables: let, next to the old one var.

我知道这两者之间的区别,但我在问自己:代表什么? var 显然是变量的缩写,但是 let ?是缩写也是吗?这是从哪里来的?

I know the difference between these two, but I was asking myself: what does let stand for? var obviously is an abbreviation of 'variable', but let? Is it an abbreviation as well? Where does it come from?

我已经google了,令我惊奇的是,我找不到答案。我已经知道Swift还有一个 let 关键字(它们用于常量),但显然还有一些其他编程语言也使用它。

I googled this and to my amazement, I couldn't find an answer. I already knew Swift also has a let keyword (they use it for constants), but apparently some other programming languages use it as well.

推荐答案

它来自英语单词let。

It comes from the English word 'let'.


动词:let,let 。
1.
允许或允许:

verb: "let", "letting". 1. to allow or permit:



// Hey computer, can you please
let 
// this
night = 'wonderful'

Lisp 具有关键字 let 他自1958年以来一直在,尽管它可能来自更早。

Lisp has the keyword let and his been around since 1958, though it may have come from even earlier.

这篇关于编程中“let”变量的语言意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆