Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to print large array fully in chrome console?

I want to print an array (uniqueNames) in the Chrome Console:

> console.log(uniqueNames) 

but the problem I come across is that after

> ["Theodor", "Albertus", /* 95 other elements */ "Andreas", "Bernd", "Roland"…] <--- dots here 

screenshot

How to print the full array like the first 100 elements? I want to copy it and use in another application. Or maybe it is possible to write this array from the Chrome Console to a file (also in one line, and not as whole log)?

like image 471
static Avatar asked Apr 22 '13 15:04

static


People also ask

How do I print to console in Chrome?

Just press F12 and press the Console tab.

How do I show objects in console?

Answer: Use console. log() or JSON. stringify() Method You can use the console. log() method, if you simply wants to know what's inside an object for debugging purpose. This method will print the object in browser console.

How to print array of objects into console in JavaScript array?

Print array of objects into console in javascript array can contain multiple objects, each object contain key and value pairs enclosed in {}. Using JSON.stringfy used to print the object in json in string format.

How to show full object in chrome console?

How to show full object in Chrome console? var functor=function () { //test } functor.prop=1; console.log (functor); this only show the function part of the functor, cannot show the properties of the functor in console. Use console.dir () to output a browse-able object you can click through instead of the .toString () version, like this:

How to copy things out of chrome's console?

I just learned this easy method of copying things out of Chrome's console. When you see the data in the console, right click on it to store as global variable. Chrome will store it as a temporary variable called temp1

Is there a way to print the full array of uniquenames?

Yes - one possibility - to .append (uniqueNames), but it looks ugly (still unformatted) To print the full array in the console you can do : console.log (JSON.stringify (uniqueNames)) This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.


1 Answers

To print the full array in the console you can do : console.log(JSON.stringify(uniqueNames))

like image 193
fadomire Avatar answered Oct 07 '22 10:10

fadomire