什么是“char”关键字? [英] What is the 'char' keyword used for?

查看:531
本文介绍了什么是“char”关键字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在JavaScript中使用的 char 保留关键字是什么(作为类型声明是不必要的),特别是,使用它的正确语法是什么因为写入 char c; 会引发一个解释错误,表示缺少;

解决方案

之前的之前的

JavaScript中有很多保留用于未来使用的保留关键字。



MDN会在这里列出一些具有这种特殊未来使用状态的用户:https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words (感谢 DCoder ),您也可以阅读该文章:


以下作为未来关键字由ECMAScript规范保留。它们目前没有特殊功能,但它们可能在将来的某个时间,因此不能用作标识符。这些关键字可能不会用于严格或非严格模式。


要进一步展开为什么它被认为是保留关键字在一些地方和在一些地方它不是。 ECMAScript v3规范包括 char 作为保留关键字,但ECMAScript v5规范(开始是最常见的)不包括它。


What is the char reserved keyword used for in JavaScript (as type declaration is not necessary), and especially, what is the correct syntax to use it (could someone give me a proper full example)?

Because writing char c; throws an interpretation error saying missing ; before statement, just before the c?

解决方案

There are a lot of reserved keyword in JavaScript that are reserved for "future" use. They don't necessarily have a current use and a description.

MDN does list some of them that have this special "future use" status here : https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words (thanks to DCoder) and you can also read from that article :

The following are reserved as future keywords by the ECMAScript specification. They have no special functionality at present, but they might at some future time, so they cannot be used as identifiers. These keywords may not be used in either strict or non-strict mode.

To expand a little further as to why it's consider a reserved keyword in some places and in some places it's not. The ECMAScript v3 specification did include char as a reserved keyword, but the ECMAScript v5 specification (which is starting to be the most common one) does not include it.

这篇关于什么是“char”关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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