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

book
Output Using Variables 2/2

Tarea

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

Solución

const country = 'USA'
console.log('My country is', country, 'and I love my country');

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

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 3
single

single

const country = 'USA';

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt