console.table() in JavaScript
The console.table() method allows displaying data in tabular format on the console.
It is especially useful when working with complex array or object structures.
You can output tabular output in both arrays and objects.
var sarkilar = [
"Rüzgarda Savrulmak",
"Bir Taş Gibi",
"Cennetin Kapısını Çalmak"
];
console.table(sarkilar);
// Dizi içinde diziler:
var sayilar = [
["Bir", "İki"],
["Üç", "Dört"],
["Beş", "Altı"]
];
console.table(sayilar);
And here's an example of an object:
function Sarki(baslik, sanatci, yil, album) {
this.baslik = baslik;
this.sanatci = sanatci;
this.yil = yil;
this.album = album;
}
var favoriSarki = new Sarki(
"Fikrimin İnce Gülü",
"Zeki Müren",
"1955",
"Klasikler"
);
console.table(favoriSarki);
The console.table() method has an optional second argument:
This is an array that determines which columns to show.
To try it, open your console and see the result.
But remember, console.table() Not supported in Internet Explorer.

