-1

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:

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?

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Radhe Sham
  • 141
  • 10

2 Answers2

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.

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Vipin Kumar
  • 6,441
  • 1
  • 19
  • 25
1

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

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

Snow
  • 1,058
  • 2
  • 19
  • 47