From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/console_api/index.html | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 files/ja/web/api/console_api/index.html (limited to 'files/ja/web/api/console_api') diff --git a/files/ja/web/api/console_api/index.html b/files/ja/web/api/console_api/index.html new file mode 100644 index 0000000000..4050667e19 --- /dev/null +++ b/files/ja/web/api/console_api/index.html @@ -0,0 +1,77 @@ +--- +title: Console API +slug: Web/API/Console_API +tags: + - API + - Debugging + - Overview + - console + - dump + - log + - output + - test +translation_of: Web/API/Console_API +--- +
{{DefaultAPISidebar("Console API")}}
+ +

Console API(コンソール API)には、開発者がデバッグ作業(メッセージ、コード内の設定点での変数の値、操作の完了にかかった時間などの記録)を実行できるようにする機能が用意されています。

+ +

概念と使用方法

+ +

Console API は、一貫性のない方法ではありますが、さまざまなブラウザーで実装されている、大部分が独自の API として始まりました。 Console API 仕様は、一貫した振る舞いを定義するために作成されました。 すべての最新のブラウザーは、最終的にこの振る舞いの実装に落ち着きましたが、一部の実装には独自の機能がまだ追加されています。 これらについては、次をご覧ください。

+ + + +

使用方法は非常に簡単です — {{domxref("console")}} オブジェクト — {{domxref("window.console")}} またはワーカーの {{domxref("WorkerGlobalScope.console")}} を介して利用できます。 console のみを使用してアクセスできます — 基本的なデバッグ作業を実行するために呼び出すことができる多くのメソッドが含まれています。 通常は、ブラウザーのウェブコンソールにさまざまな値を記録することに焦点を当てています。

+ +

最も一般的に使用されるメソッドは {{domxref("console.log")}} で、特定の変数に含まれる現在の値を記録するために使用します。

+ +

インターフェイス

+ +
+
{{domxref("console")}}
+
記録、スタックトレース、タイマー、カウンターなどの基本的なデバッグ機能を提供します。
+
+ +

+ +
let myString = 'Hello world';
+
+// "Hello world" をコンソールに出力
+console.log(myString)
+ +

その他の例については、console のリファレンスページを参照してください。

+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Console API')}}{{Spec2('Console API')}}初期定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Console")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf