编程语言中『一等公民』是什么公民?

来源:互联网 发布:惠州网络 问政平台 编辑:程序博客网 时间:2024/05/01 13:01

在 JavaScript 中总是见到一等公民字样,一直很纳闷,什么是一等公民???

用必应词典翻译一下,英文叫first-class citizen,再维基百科一下

In programming language design, a first-class citizen (also type, object, entity, or value) in a given programming language is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, and assigned to a variable.

└(^o^)┘

0 0
原创粉丝点击