Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Output Using Variables 2/2 | Introduction
Introduction to JavaScript

Swipe to show menu

book
Output Using Variables 2/2

Task

Swipe to start coding

A variable named country has been given to you. Your task is, using the above variable, to print the statement My country is USA and I love my country in the console window using console.log

Solution

Summary:

  • The console.log() in JavaScript is used to display output to the users.

  • JavaScript support both single-quotes as well as double-quotes.

  • Variables can also be passed into the console.log() and they have to be separated by a comma ,.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 3
We're sorry to hear that something went wrong. What happened?

Ask AI

expand
ChatGPT

Ask anything or try one of the suggested questions to begin our chat

book
Output Using Variables 2/2

Task

Swipe to start coding

A variable named country has been given to you. Your task is, using the above variable, to print the statement My country is USA and I love my country in the console window using console.log

Solution

Summary:

  • The console.log() in JavaScript is used to display output to the users.

  • JavaScript support both single-quotes as well as double-quotes.

  • Variables can also be passed into the console.log() and they have to be separated by a comma ,.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 3
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt