简体   繁体   English

Javascript做什么。 在console.log()之后在控制台中未定义

[英]Javascript what does <. undefined in console after console.log()

Below is a simple code 下面是一个简单的代码

var stop = true;
console.log(stop);  

In console is show like this: 在控制台中显示如下:

   true  
<. undefined  // what this undefined, is it some reference.  

I am wondering what is undefined 我想知道什么是undefined

Every statement in JavaScript returns something. JavaScript中的每个语句都返回一些内容。

When you enter console.log(true), true will be printed out and undefined will be returned. 当您输入console.log(true),将输出true并返回undefined

undefined is one of the seven types in JavaScript that means something has been declared but not assigned a value. undefined是JavaScript中的七种类型之一,表示已声明某些内容但未为其赋值。

undefined is the return value of console.log statements. undefinedconsole.log语句的返回值。

It's the return value of the console.log function. 它是console.log函数的返回值。 The true that you see is a side-effect. 您所看到的true是有副作用的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM