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
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)?
Just press F12 and press the Console tab.
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.
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? 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:
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
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.
To print the full array in the console you can do : console.log(JSON.stringify(uniqueNames))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With