Console.log()

To tłumaczenie jest niepełne. Pomóż przetłumaczyć ten artykuł z języka angielskiego

Niestandardowy
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.

Wyświetla tekst w konsoli.

Uwaga: This feature is available in Web Workers.

Syntax

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

Parameters

obj1 ... objN
Lista obiektów JavaScript do wyświelenia. Podane obiekty są kolejno dołączane i przekazywane na wyjście.
msg
String JavaScript zawierający zero lub więcej stringów podmieniających.
subst1 ... substN
Obiekt JavaScript w którym zastępowane są stringi podmieniające z msg.  Daje Ci to dodatkową kontrolę nad formatem.

Zobacz również Outputting text to the console w dokumentacji console.

Specifications

Specyfikacja Status Komentarz
Console API
The definition of 'console.log()' in that specification.
Living Standard Początkowa definicja

Browser compatibility

 

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
logChrome Full support 1Edge Full support 12Firefox Full support 4IE Full support 8Opera Full support 10.5Safari Full support 3WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 11Safari iOS Full support 1Samsung Internet Android Full support 1.0
Substitution stringsChrome Full support 1
Notes
Full support 1
Notes
Notes In version 28, if a negative value is passed to %d, it will be rounded down to the closest negative integer, so -0.1 becomes -1.
Edge Full support 12
Notes
Full support 12
Notes
Notes Before Edge 79, %c is not supported.
Notes Before Edge 79, %d outputs a 0 if the specified value isn't a number.
Firefox Full support 9IE Full support 10
Notes
Full support 10
Notes
Notes %c is not supported.
Notes %d outputs a 0 if the specified value isn't a number.
Opera Full support 15Safari ? WebView Android Full support 1
Notes
Full support 1
Notes
Notes In version 28, if a negative value is passed to %d, it will be rounded down to the closest negative integer, so -0.1 becomes -1.
Chrome Android Full support 18
Notes
Full support 18
Notes
Notes In version 28, if a negative value is passed to %d, it will be rounded down to the closest negative integer, so -0.1 becomes -1.
Firefox Android Full support 9Opera Android Full support 14Safari iOS ? Samsung Internet Android Full support 1.0
Notes
Full support 1.0
Notes
Notes In Samsung Internet 1.5, if a negative value is passed to %d, it will be rounded down to the closest negative integer, so -0.1 becomes -1.

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

 

Zobacz również