console使用方法

2022-01-20 09:03:01 字數 2434 閱讀 5022

一般情況下我們用來輸入資訊的方法主要如下四個:

1、console.log用於輸出普通資訊

2、console.info用於輸出提示性資訊

3、console.error用於輸出錯誤資訊

4、console.warn用於輸出警示資訊

5、console.debug用於輸出除錯資訊

console物件的上面5種方法,都可以使用printf風格的佔位符。不過,佔位符的種模擬較少,只支援字元(%s)、整數(%d或%i)、浮點數(%f)和物件(%o)四種

console.log("%cdddd.com","background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(100%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);filter: progid:dximagetransform.microsoft.gradient( startcolorstr='#fceabb', endcolorstr='#f51634', gradienttype=1 );font-size:5em");
結果如下:

Laravel的console使用方法

適用場景 分析資料 日誌 php artisan make console 你的命令類名 示例 1.php artisan make console newsscript use illuminate console command class newsscript extends command ...

console對應的使用方法

向標準輸出流列印字元並以換行符結束。該方法接收若干 個引數,如果只有乙個引數,則輸出這個引數的字串形式。如果有多個引數,則 以類似於c 語言 printf 命令的格式輸出。該命令的作用是返回資訊性訊息,這個命令與console.log差別並不大,除了在chrome中只會輸出文字外,其餘的會顯示乙個藍...

控制台console的一些使用方法

我們通過使用console.log 形式輸入資訊。但是,它也可以輸出別的形式檢視資訊。比如 我們有時候想檢視這個物件身上有什麼屬性或者方法,就可以通過物件方式輸出 如果我們想檢視不同樣式的資訊,可以通過設定樣式形式輸出 如果我們想檢視類似陣列形式的資訊,可以使用以一組的形式輸出 下圖為例 物件形式的...