次の方法で共有


warn method

Sends a warning message to the console. The message is prefaced by the warning icon.

 

Syntax

Console.warn(message, optionalParams);

Parameters

  • message [in]
    Type: DOMString

    The message to display.

  • optionalParams [in]
    Type: any

    A value or string that can be used with replaceable parameters in the main message.

Return value

This method does not return a value.

Remarks

The optional parameters can be used to provide a replaceable value in the message. For example, you could include a specific message to warn about as the optional parameter, rather than building a string by concatenating the warning message to the message string.

  function sendWarnConsole(warningMsg) {
        window.console.warn("customer %s record is incomplete", warningMsg);
    }

See also

Console