Back to Course

Introduction to JavaScript

0% Complete
0/0 Steps
  1. JavaScript: Basics
    9Topics
    |
    10 Quizzes
  2. JavaScript: Variables
    9Topics
    |
    10 Quizzes
  3. JavaScript: Conditional Statements
    10Topics
    |
    11 Quizzes
  4. JavaScript: Functions
    10Topics
    |
    11 Quizzes
  5. JavaScript: Scope
    6Topics
    |
    7 Quizzes
  6. JavaScript: Arrays
    11Topics
    |
    12 Quizzes
  7. JavaScript: Loops
    8Topics
    |
    9 Quizzes
  8. JavaScript: High Order Functions
    3Topics
    |
    4 Quizzes
  9. JavaScript: Iterators
    6Topics
    |
    6 Quizzes
Lesson 1, Topic 2
In Progress

JavaScript: Console

Yasin Cakal 26 Oct 2021
Lesson Progress
0% Complete

The console is a display panel for developers that shows all the important messages such as errors, system details, etc. By default, the computer does a lot of work with our code that we can’t see on the screen. We can print or log to our console directly if we want to see things displayed on our screen.

The console keyword in JavaScript refers to an object, which is a collection of data and actions that we may use in our code. Keywords are terms embedded into the JavaScript language that the computer recognizes and treats accordingly.

The .log() method is one of the built-in methods (or actions) of the console object. Whatever we put inside the parentheses will be printed, or logged, to the consolewhen we use console.log().Printing values to the console will be very important for us so that we can see our progress.

console.log(12);

This example outputs the number 12 to the console. A semicolon marks the conclusion of a line or a statement. Although your JavaScript code will typically work without a semicolon, we encourage that you get into the habit of terminating each statement with one so that you don’t forget to use one when it’s needed.

Later on, we’ll see how to utilize console.log() to print various types of data.

%d bloggers like this: