Questions tagged [console.log]

a debugging tool for JavaScript. It is method of the console object which logs the given object in the Browser's JS console.

log method of the console object is a method mainly used for debugging purposes.

Syntax

console.log(obj1 [, obj2, ..., objN]);

Parameters

obj1...objN - A list of JavaScript objects to output. The string representations of each of these objects are appended together in the order listed and output.

Example

Here is a simple JavaScript example which illustrates the use of console.log:

var foo = {'id':7, 'name':'John Doe'};
console.log(foo);

Output (in the console) - {id:7, name:"John Doe"}.

Note - The result my vary depending upon the browser's implementation of console.

Browser Compatibility

This feature is fully-supported on the latest versions of all the major browsers.

  • Mozilla Firefox 4+
  • Microsoft Internet Explorer 8+ (only after opening the F12 developer tools)
  • Google Chrome 1+
  • Opera 10.50+
  • Apple Safari 3+
2040 questions
0
votes
0 answers

Calling API or logging into the console?

I have a node.js app and I need to implement statistics for it. I have two ways: writing into the console.log and then capturing it using some tool (AWS CloudWatch Metrics) or calling AWS API and send stats over the Internet. The thing is: Writing…
Ruslan Plastun
  • 1,985
  • 3
  • 21
  • 48
0
votes
0 answers

where is console.log file?

I'writing an addon for Firefox... (and load it from URL tools "about:debugging#addons") I try this code (from https://developer.mozilla.org/fr/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest): function cancel(requestDetails) { …
Anbia
  • 1
  • 2
0
votes
0 answers

Not showing inside console window and network tab

The second part is the html code and the first part is the angularjs part . customer.controller("new_info", function($scope, $routeParams,$http) { $scope.customer = {}; $scope.register = function () { …
0
votes
0 answers

not showing anything in network tab and console.log("posted successfully")

Front-end customer.controller("new_info", function($scope, $routeParams,$http) { $scope.customer = {}; $scope.register = function () { $http.post('localhost:4000/new_info', $scope.customer).then( function (response) {…
0
votes
0 answers

no console.log answer while posting

Front-End app.factory('CustomerService', function($http) { return { addCustomerToDb : function(customer) { return $http.post('localhost:4000/new_info', customer) .success(function(response) { …
0
votes
3 answers

Console.log not outputting json

var _json = [{"codigo": "1", "nome": "Robert Santos", "turma": "EM2A"}, {"codigo": "2", "nome": "Eduardo Alves Silveira", "turma": "EM3A"}, {"codigo": "3", "nome": "Amara Gouveia", "turma": "EMT2B"}, {"codigo": "4", "nome": "Tainá Belchior da…
Karlna
  • 67
  • 2
  • 11
0
votes
2 answers

How do I convert to binary in javascript? How do I have a recursive function return data from each call all at once?

Header: I am console.logging what I want to return. I want to have a data structure store the necessary powers of 2 that I am calculating, but because it's recursive, I'm having trouble saving the output in a string or array without the data…
0
votes
2 answers

console.log issue in a local folder

I just wonder what I am doing with console.log is wrong or not. I have simple two files as below: index.html index.js and when opening the index.html in chrome(c:\temp\index.html), it does not output console.log message in console tab as below. So…
Infinity Challenger
  • 1,090
  • 10
  • 19
0
votes
1 answer

Console.log(responseObject) outputs hidden data that can't be referenced via the object which is what I am desperatly trying to do

I am trying to detect when an SSL handshake to a website fails. Right now, I have a response object that looks like this: let r = request({url:"url", method: "HEAD", ...}, (res) => { console.log(res) }) This outputs the following log: { Error:…
Nicholas Kolatsis
  • 427
  • 1
  • 5
  • 9
0
votes
0 answers

Javascript override console.log Globally

I want to override my console.log function globally. I have multiple JS file where I want to use the changed console.log. New console.log will use the stdout so i can see on the console and also it will log into a file.
mszabolcs
  • 67
  • 1
  • 10
0
votes
0 answers

Give meaningful name to google_debug.log on Chrome@Windows

I will test some urls automatically with Chrome on Windows, using parametrized start from CMD. After tests i want to save console.log from each test into own file with meaningful file name. On passing of --enable-logging --v=1 as start parameter all…
Evgeniy
  • 2,337
  • 2
  • 28
  • 68
0
votes
1 answer

Console.log not displaying anything in Chrome browser

This is my code. I am trying to check if I am able to get the data from the api. Putting the api url in the browser shows the json data but console.log does not show anything. $('document').ready(function() { $('#lesotho').click(function() { …
0
votes
2 answers

console.log not working in non-icognito mode in Chrome

I have a problem with console.log in regular mode in Google Chrome. The same code logs correctly in Opera and in incognito mode in Chrome. Here I've read recommendations to turn off Firebug extention but I don't have it. Console.log messages not…
yaufol
  • 3
  • 4
0
votes
1 answer

Bug in JavaScript Google Chrome console when printing object

For some reason, printing an array of objects in console.log() doesn't print each object correctly. When I loop through the array for each individual object and print its property I am interested in, it differs from the object being printed in the…
0
votes
1 answer

Javascript 30 "Drum kit" console.log Issue

I'm doing the JavaScript 30 and I have an issue with the beginning of the JavaScript Drum Kit. I have followed the code exactly, but I seem to have an issue with the the first fews lines of JavaScript in the program. I need it to console.log
R Gao
  • 19
  • 1
  • 7
1 2 3
99
100