Key Concepts

Review core concepts you need to learn to master this subject

console.log()

console.log('Hi there!'); // Prints: Hi there!

The console.log() method is used to log or print messages to the console. It can also be used to print objects and other info.

Introduction to JavaScript
Lesson 1 of 2
  1. 1
    Last year, millions of learners from our community started with JavaScript. Why? JavaScript is primarily known as the language of most modern web browsers, and its early quirks gave it a bit of a b…
  2. 2
    The console is a panel that displays important messages, like errors, for developers. Much of the work the computer does with our code is invisible to us by default. If we want to see things appear…
  3. 3
    Programming is often highly collaborative. In addition, our own code can quickly become difficult to understand when we return to it— sometimes only an hour later! For these reasons, it’s oft…
  4. 4
    Data types are the classifications we give to the different kinds of data that we use in programming. In JavaScript, there are seven fundamental data types: - Number: Any number, including nu…
  5. 5
    Basic arithmetic often comes in handy when programming. An operator is a character that performs a task in our code. JavaScript has several built-in arithmetic operators, that allow us to per…
  6. 6
    Operators aren’t just for numbers! When a + operator is used on two strings, it appends the right string to the left string: console.log(‘hi’ + ‘ya’); // Prints ‘hiya’ console.log(‘wo’ + ‘ah’); /…
  7. 7
    When you introduce a new piece of data into a JavaScript program, the browser saves it as an instance of the data type. Every string instance has a property called length that stores the number of…
  8. 8
    Remember that methods are actions we can perform. JavaScript provides a number of string methods. We call, or use, these methods by appending an instance with: - a period (the dot operator) - t…
  9. 9
    In addition to console, there are other objects built into JavaScript . Down the line, you’ll build your own objects, but for now these “built-in” objects are full of useful functionality. For e…
  10. 10
    Let’s take one more glance at the concepts we just learned: - Data is printed, or logged, to the console, a panel that displays messages, with console.log(). - We can write single-line comments wi…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo