Informasi konsol ()
Contoh
Tulis pesan ke konsol:
console.info("Hello world!");
Lebih banyak contoh di bawah ini.
Definisi dan Penggunaan
Metode info()
ini menulis pesan ke konsol.
Catatan
Saat menguji metode konsol, pastikan tampilan konsol terlihat.
Tekan F12 untuk membuka tampilan konsol.
Sintaksis
console.info(message)
Parameter
Parameter | Description |
message | Required. The message to write to the console. |
Lebih Banyak Contoh
Menggunakan objek sebagai pesan:
const myObj = {firstname:"John", lastname:"Doe"};
console.info(myObj);
Menggunakan array sebagai pesan:
const myArr = ["Orange", "Banana", "Mango", "Kiwi"];
console.info(myObj);
Dukungan Peramban
console.info()
didukung di semua browser:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 8-11 | Yes | Yes | Yes | Yes |