Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

differecne between console.log() and console.dir()

var str = "Howdy GeeksforGeeks"
var geek = {
  book: "harrypotter",
  price: "2000"
};
var geek2 = [10, 20, 30];
console.log(str);
console.dir(str);
console.dir(geek);
console.log("geek (log) = ", geek);
console.dir(geek2);
console.log("geek2 (log) = ", geek2);

// Prints only string as dir() takes 
// only one parameter. 
console.dir("geek2 (dir) = ", geek2);
Comment

console.dir vs console.log

> console.log([1,2,3])
[1, 2, 3]

> console.dir([1,2,3])
* Array[3]
    0: 1
    1: 2
    2: 3
    length: 3
    * __proto__: Array[0]
        concat: function concat() { [native code] }
        constructor: function Array() { [native code] }
        entries: function entries() { [native code] }
        ...
Comment

PREVIOUS NEXT
Code Example
Javascript :: csvString to json 
Javascript :: javascript float not showing 0 
Javascript :: node javascript retry promise.all 
Javascript :: get all keys of nested object json data javascript 
Javascript :: api dfetch data in reactjs 
Javascript :: Using the Unshift() Method to Reverse an Array 
Javascript :: getData(x, y, callback) and showData() callback function 
Javascript :: Custom usePagination hook example 
Javascript :: Default function arguments in ES6 
Javascript :: react get query params from url 
Javascript :: prevent the fire of parent event listener 
Javascript :: cypress contains regex 
Javascript :: react-navigation: Detect when screen, tabbar is activated / appear / focus / blur 
Javascript :: tampermonkey all pages 
Javascript :: antd table access data from object //with dot 
Javascript :: delayed usestate double click 
Javascript :: sempole reguler expretion 
Javascript :: vue ignore not used error 
Javascript :: CalendarApp.newRecurrence 
Javascript :: getting ad to close jquery 
Javascript :: react Mixed symbols 
Javascript :: change the input feild name when the div contaoining that field is cloned using jquery 
Javascript :: TYPING TEXT USING JS1 
Javascript :: github react hardhat nft marketplace application 
Javascript :: rails + vue js projcet demo 
Javascript :: como fazer piramade de asteriscos 
Javascript :: form react js 
Javascript :: graal.js javascript array in java 
Javascript :: birth day quote 
Javascript :: node load testing-basic 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =