Console.warn()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Escreve uma mensagem de alerta no Console Web.

Nota: This feature is available in Web Workers.

Nota: No Firefox, warnings têm um pequeno icone de ponto de exclamação perto deles no log do Console Web.

Sintaxe

console.warn(obj1 [, obj2, ..., objN]);
console.warn(msg [, subst1, ..., substN]);

Parâmetros

obj1 ... objN

Uma lista de objetos JavaScript para escrever. A representação String de cada um destes objetos é ligada junto na ordem listada e escrita.

msg

Uma string JavaScript contendo zero ou mais strings de substituição.

subst1 ... substN

Objetos JavaScript com qual as strings de substituição msg serão substituidas. Isto dá um contriole adicional sobre a mensagem que será escrita.

Ver Outputting text to the console na documentação do console para mais detalhes.

Especificações

Specification
Console
# warn

Compatibilidade com navegadores

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
warn() static method

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.

Ver também