Difference between revisions of "Console.log"
From OdleWiki
(Created page with "'''console.log()''' outputs whatever information is contained within the parentheses (whether variable, string, or function) and logs it to the browser console. Categor...") |
m (Adding examples) |
||
Line 1: | Line 1: | ||
'''console.log()''' outputs whatever information is contained within the parentheses (whether variable, string, or function) and logs it to the [[browser console]]. | '''console.log()''' outputs whatever information is contained within the parentheses (whether variable, string, or function) and logs it to the [[browser console]]. | ||
+ | |||
+ | == Examples == | ||
+ | |||
+ | === Logging a String === | ||
+ | |||
+ | <code> | ||
+ | console.log( "The script has completed." ); | ||
+ | </code> | ||
+ | |||
+ | === Logging the Result of a Function === | ||
+ | |||
+ | <code> | ||
+ | console.log(); | ||
+ | </code> | ||
[[Category:JavaScript]] | [[Category:JavaScript]] | ||
[[Category:Stub]] | [[Category:Stub]] |
Revision as of 23:37, 2 January 2016
console.log() outputs whatever information is contained within the parentheses (whether variable, string, or function) and logs it to the browser console.
Examples
Logging a String
console.log( "The script has completed." );
Logging the Result of a Function
console.log();