Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen JavaScript Variables | JavaScript syntax
Introduction to JavaScript

book
JavaScript Variables

In JavaScript, variables are used to store data. JavaScript variables are “named storage” for data. We can access the value of the variable by using variable name. We can use the variables to store different kinds of data like numbers, text, Boolean, etc.

JavaScript variables syntax:

A variable in JavaScript has a name, a value, and a memory address.

  • The name of the variable distinctively identifies the variable.

  • The value refers to data stored in the variable.

  • The memory address refers to the memory location of the variable.

const climate ="spring";
console.log(climate);
12
const climate ="spring"; console.log(climate);
copy
Aufgabe

Swipe to start coding

Create two variables named firstValue, and secondValue. Assign 50 to firstValue and 20 to secondValue and print both the variables using the console.log() function.

Lösung

const firstValue = 50;
console.log(firstValue);

const secondValue= 20;
console.log(secondValue);

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 2

Fragen Sie AI

expand
ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

We use cookies to make your experience better!
some-alt