什么是“小于点"?Chrome控制台输出中的符号意

What#39;s the quot;less than dotquot; symbol mean in Chrome console output?(什么是“小于点?Chrome控制台输出中的符号意味着什么?)
本文介绍了什么是“小于点"?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控制台输出中的符号意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Update another component when Formik form changes(当Formik表单更改时更新另一个组件)
Formik validation isSubmitting / isValidating not getting set to true(Formik验证正在提交/isValiating未设置为True)
React Validation Max Range Using Formik(使用Formik的Reaction验证最大范围)
Validation using Yup to check string or number length(使用YUP检查字符串或数字长度的验证)
Updating initialValues prop on Formik Form does not update input value(更新Formik表单上的初始值属性不会更新输入值)
password validation with yup and formik(使用YUP和Formick进行密码验证)