
好词典

源自拉丁语 'littera'(字母),后演变为英语 'literal'(字面的),加上复数后缀 '-s' 形成。
❶ 字面量,指在编程或数学中直接表示固定值的符号或记号,如数字、字符串等,无需通过变量或计算得出。
“In Python, the number 5 and the string 'hello' are both literals.”
(在Python中,数字5和字符串'hello'都是字面量。)
“Boolean literals in JavaScript include true and false.”
(JavaScript中的布尔字面量包括true和false。)
numeric literals — 数字字面量,指直接在代码中表示数字的固定值,如整数或浮点数。
“Numeric literals like 42 or 3.14 are used frequently in calculations.”
(像42或3.14这样的数字字面量在计算中经常使用。)
string literals — 字符串字面量,指在代码中直接表示的文本值,通常用引号括起来。
“String literals such as 'Hello' and "World" are common in programming.”
(像'Hello'和"World"这样的字符串字面量在编程中很常见。)