はじめに フロントエンドのWeb開発においてconsole.log()というのは非常によくお世話になります. しかしconsoleオブジェクトにはには他にもたくさんのインスタンスメソッドがあり,それらを使わずに開発を行うのは少しもったいないです. この記事では様々な機能を紹介していき明日から開発で使用していただければ嬉しいです. assert console.assert()は第一引数に論理式をとり,第二引数以降には任意のオブジェクトを取ります. 第一引数がfalseとなった場合,第二引数をコンソールに出力します. サンプル // assert const wishToSuccess = () => { return Math.random() < 0.5 } console.assert(wishToSuccess(), "失敗しました") 出力 log 一般的にログを出力するconso
![console.log()だけのデバッグはやめよう](https://cdn-ak-scissors.b.st-hatena.com/image/square/732e0b57ae96c8abd852bf6de1ca0cd9166ab83e/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--lwd-Q_Xc--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3Aconsole.log%252528%252529%2525E3%252581%2525A0%2525E3%252581%252591%2525E3%252581%2525AE%2525E3%252583%252587%2525E3%252583%252590%2525E3%252583%252583%2525E3%252582%2525B0%2525E3%252581%2525AF%2525E3%252582%252584%2525E3%252582%252581%2525E3%252582%252588%2525E3%252581%252586%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3Afujiyamaorange%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYXZhdGFyL2I2Y2RmMzViNTQuanBlZw%3D%3D%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)