What#39;s the quot;less than dotquot; symbol mean in Chrome console output?(什么是“小于点?Chrome控制台输出中的符号意味着什么?)
问题描述
有时,但并非总是如此,当 Chrome JavaScript 控制台中的评估结果导致未定义"时,左边距中有一个看起来像带点的小于号的符号.
Sometimes, but not always, when the result of an evaluation in the Chrome JavaScript console results in "undefined", there is a symbol in the left margin that looks like a less-than symbol with a dot.
示例可以在 Chrome 开发者工具文档的这一部分.
但该符号的含义似乎从未得到解释.有人知道它想表达什么吗?谢谢.
But what that symbol means does not appear to ever be explained. Does anybody know what it's trying to convey? Thanks.
推荐答案
每当命令行运行一组函数时,控制台输出的最后一行总是输入中最后一个操作的返回值.当命令执行开始后有控制台输出时,该符号调用函数的返回值.这是为了避免在这种情况下产生混淆:
Whenever a set of function runs on the command line, the last line of console output is always the returned value of the last operation in the input. The symbol calls out the return value of a function when there has been console output since the start of the command execution. This is to avoid confusion in a case like this:
function logVar(someVar) {
console.log(someVar);
}
当你在控制台运行logVar时,它会输出someVar的值.然而,logVar 的返回值也会被记录下来(这里是 undefined).将返回值与记录的变量在视觉上区分开来是很有帮助的,因此您不必查看输出的最后一行并想知道为什么我的变量 undefined?".
When you run logVar on the console, it outputs the value of someVar. However, the return value of logVar is also logged (here, undefined). It's helpful to have the return value visually distinguished from the logged variable, so you don't look at the last line of the output and wonder, "Why is my variable undefined?".
这篇关于什么是“小于点"?Chrome控制台输出中的符号意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:什么是“小于点"?Chrome控制台输出中的符号意
基础教程推荐
- Bokeh Div文本对齐 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
