Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Build Sentences with JavaScript | Performing Operations in JavaScript
Introduction to JavaScript
course content

Contenuti del Corso

Introduction to JavaScript

Introduction to JavaScript

1. JavaScript Fundamentals
2. Variables and Data Types in JavaScript
3. Performing Operations in JavaScript
4. Controlling Program Flow with Conditional Statements
5. Looping Through Data in JavaScript
6. Functions in JavaScript

book
Challenge: Build Sentences with JavaScript

Task

Let's build a full sentence using string concatenation.

  1. Create the string "I am hungry!" using the + operator.
  2. Add words with spaces (except the first one) using the += operator.
12345678
let sentence = ""; sentence += "___"; // "I" sentence += "___"; // "I am" sentence += "___"; // "I am hungry" sentence += "___"; // "I am hungry!" console.log(sentence);
copy

The output should be:

python

Add words with spaces (e.g., " am"" hungry").

12345678
let sentence = ""; sentence += "I"; // "I" sentence += " am"; // "I am" sentence += " hungry"; // "I am hungry" sentence += "!"; // "I am hungry!" console.log(sentence);
copy

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 10
Siamo spiacenti che qualcosa sia andato storto. Cosa è successo?
some-alt