SongGuess
    Preparing search index...

    The console object provides access to the debugging console (e.g., the Web console in Firefox).

    MDN Reference

    interface Console {
        Console: {
            prototype: Console;
            new (
                stdout: WritableStream,
                stderr?: WritableStream,
                ignoreErrors?: boolean,
            ): Console;
            new (options: ConsoleOptions): Console;
        };
        assert(condition?: boolean, ...data: any[]): void;
        assert(condition?: boolean, ...data: any[]): void;
        clear(): void;
        clear(): void;
        count(label?: string): void;
        count(label?: string): void;
        countReset(label?: string): void;
        countReset(label?: string): void;
        debug(...data: any[]): void;
        debug(...data: any[]): void;
        dir(item?: any, options?: any): void;
        dir(item?: any, options?: any): void;
        dirxml(...data: any[]): void;
        dirxml(...data: any[]): void;
        error(...data: any[]): void;
        error(...data: any[]): void;
        group(...data: any[]): void;
        group(...data: any[]): void;
        groupCollapsed(...data: any[]): void;
        groupCollapsed(...data: any[]): void;
        groupEnd(): void;
        groupEnd(): void;
        info(...data: any[]): void;
        info(...data: any[]): void;
        log(...data: any[]): void;
        log(...data: any[]): void;
        profile(label?: string): void;
        profileEnd(label?: string): void;
        table(tabularData?: any, properties?: string[]): void;
        table(tabularData?: any, properties?: string[]): void;
        time(label?: string): void;
        time(label?: string): void;
        timeEnd(label?: string): void;
        timeEnd(label?: string): void;
        timeLog(label?: string, ...data: any[]): void;
        timeLog(label?: string, ...data: any[]): void;
        timeStamp(label?: string): void;
        timeStamp(label?: string): void;
        trace(...data: any[]): void;
        trace(...data: any[]): void;
        warn(...data: any[]): void;
        warn(...data: any[]): void;
    }

    Hierarchy

    • Console
      • Console
    Index

    Properties

    Console: {
        prototype: Console;
        new (
            stdout: WritableStream,
            stderr?: WritableStream,
            ignoreErrors?: boolean,
        ): Console;
        new (options: ConsoleOptions): Console;
    }

    Methods

    • The console.assert() static method writes an error message to the console if the assertion is false. If the assertion is true, nothing happens.

      MDN Reference

      Parameters

      • Optionalcondition: boolean
      • ...data: any[]

      Returns void

    • Parameters

      • Optionalcondition: boolean
      • ...data: any[]

      Returns void

    • The console.clear() static method clears the console if possible.

      MDN Reference

      Returns void

    • The console.clear() static method clears the console if possible.

      MDN Reference

      Returns void

    • The console.count() static method logs the number of times that this particular call to count() has been called.

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.count() static method logs the number of times that this particular call to count() has been called.

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.countReset() static method resets counter used with console.count().

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.countReset() static method resets counter used with console/count_static.

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.debug() static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.debug() static method outputs a message to the console at the 'debug' log level.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.dir() static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.

      MDN Reference

      Parameters

      • Optionalitem: any
      • Optionaloptions: any

      Returns void

    • The console.dir() static method displays a list of the properties of the specified JavaScript object.

      MDN Reference

      Parameters

      • Optionalitem: any
      • Optionaloptions: any

      Returns void

    • The console.dirxml() static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.dirxml() static method displays an interactive tree of the descendant elements of the specified XML/HTML element.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.error() static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.error() static method outputs a message to the console at the 'error' log level.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.group() static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.group() static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.groupCollapsed() static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.groupCollapsed() static method creates a new inline group in the console.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.groupEnd() static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples.

      MDN Reference

      Returns void

    • The console.groupEnd() static method exits the current inline group in the console.

      MDN Reference

      Returns void

    • The console.info() static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.info() static method outputs a message to the console at the 'info' log level.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.log() static method outputs a message to the console.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.log() static method outputs a message to the console.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • This method does not display anything unless used in the inspector. The console.profile() method starts a JavaScript CPU profile with an optional label until profileEnd is called. The profile is then added to the Profile panel of the inspector.

      console.profile('MyLabel');
      // Some code
      console.profileEnd('MyLabel');
      // Adds the profile 'MyLabel' to the Profiles panel of the inspector.

      Parameters

      • Optionallabel: string

      Returns void

      v8.0.0

    • This method does not display anything unless used in the inspector. Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. See profile for an example.

      If this method is called without a label, the most recently started profile is stopped.

      Parameters

      • Optionallabel: string

      Returns void

      v8.0.0

    • The console.table() static method displays tabular data as a table.

      MDN Reference

      Parameters

      • OptionaltabularData: any
      • Optionalproperties: string[]

      Returns void

    • The console.table() static method displays tabular data as a table.

      MDN Reference

      Parameters

      • OptionaltabularData: any
      • Optionalproperties: string[]

      Returns void

    • The console.time() static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.time() static method starts a timer you can use to track how long an operation takes.

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.timeEnd() static method stops a timer that was previously started by calling console.time().

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.timeEnd() static method stops a timer that was previously started by calling console/time_static.

      MDN Reference

      Parameters

      • Optionallabel: string

      Returns void

    • The console.timeLog() static method logs the current value of a timer that was previously started by calling console.time().

      MDN Reference

      Parameters

      • Optionallabel: string
      • ...data: any[]

      Returns void

    • The console.timeLog() static method logs the current value of a timer that was previously started by calling console/time_static.

      MDN Reference

      Parameters

      • Optionallabel: string
      • ...data: any[]

      Returns void

    • The console.timeStamp() static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events.

      Parameters

      • Optionallabel: string

      Returns void

    • Parameters

      • Optionallabel: string

      Returns void

    • The console.trace() static method outputs a stack trace to the console.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.trace() static method outputs a stack trace to the console.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.warn() static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void

    • The console.warn() static method outputs a warning message to the console at the 'warning' log level.

      MDN Reference

      Parameters

      • ...data: any[]

      Returns void