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

bookOutput Using Variables 2/2

Tâche

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

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 3
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you show an example of using variables with console.log()?

What is the difference between using single and double quotes in JavaScript?

Are there other ways to display output in JavaScript besides console.log()?

close

bookOutput Using Variables 2/2

Glissez pour afficher le menu

Tâche

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 desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 3
single

single

some-alt