console.log()是一个javascript内置方法吗? [重复]

时间:2023-01-15 19:05:18

This question already has an answer here:

这个问题在这里已有答案:

I'm working with angular js. My project includes only the angular.min.js file, with no other references of js files like javascript etc. The code which makes request to the server is as follows:

我正在使用角度js。我的项目只包含angular.min.js文件,没有其他js文件的引用,如javascript等。向服务器发出请求的代码如下:

var app = angular
  .module("myModule", [])
  .controller("myController", function($scope, $http) {

    $http.get("WebService.asmx/GetAllEmployees")
      .then(function(response) {
        $scope.employees = response.data;
        console.log(response.data)
      }, function(reason) {
        $scope.error = reason.data;
      });
  });

I'm wondering about the following line:

我想知道以下几行:

console.log(response.data)

I could not figure out who's property this function is?

我无法弄清楚这个功能是谁的属性?

Is this browser builtin function?

这个浏览器内置功能吗?

2 个解决方案

#1


1  

console.log() is a feature for debugging purposes. It allows a script to log data to the JavaScript console.

console.log()是一个用于调试目的的功能。它允许脚本将数据记录到JavaScript控制台。

If you want to display the message from console.log() in your browser, you need to access the browser's console.

如果要在浏览器中显示来自console.log()的消息,则需要访问浏览器的控制台。

#2


3  

Yes, it's built in function.

是的,它内置功能。

console is an object which resides in any global (for example window) object of JavaScript. This object contains various methods, out of which log is the one. This displays anything you put on browser console.

console是一个驻留在JavaScript的任何全局(例如窗口)对象中的对象。该对象包含各种方法,其中日志就是其中之一。这会显示您在浏览器控制台上放置的任

#1


1  

console.log() is a feature for debugging purposes. It allows a script to log data to the JavaScript console.

console.log()是一个用于调试目的的功能。它允许脚本将数据记录到JavaScript控制台。

If you want to display the message from console.log() in your browser, you need to access the browser's console.

如果要在浏览器中显示来自console.log()的消息,则需要访问浏览器的控制台。

#2


3  

Yes, it's built in function.

是的,它内置功能。

console is an object which resides in any global (for example window) object of JavaScript. This object contains various methods, out of which log is the one. This displays anything you put on browser console.

console是一个驻留在JavaScript的任何全局(例如窗口)对象中的对象。该对象包含各种方法,其中日志就是其中之一。这会显示您在浏览器控制台上放置的任