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

Pyyhkäise näyttääksesi valikon

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.

12
const climate ="spring"; console.log(climate);
copy
Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 2
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 2

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.

12
const climate ="spring"; console.log(climate);
copy
Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

close

Awesome!

Completion rate improved to 2

Pyyhkäise näyttääksesi valikon

some-alt