A symbol looks like a variable symbols
name, but it’s prefixed with a colon. Examples of symbols include :action,
:line_items, and :id. You can think of symbols as string literals that are
magically made into constants. Alternatively, you can consider the colon
to mean “thing named” so :id is “the thing named id.”
本文介绍了编程中符号的概念及其用法。符号类似于变量名但前缀有冒号,如:action、:line_items等。可以将符号理解为被神奇地转换成常量的字符串字面量,或者视为特定名称的事物。
144

被折叠的 条评论
为什么被折叠?



