terms Flashcards

1
Q

string

A

In JavaScript, when we surround a word with quotes it’s called a string, and when we’re done with a line of code we finish it with a semicolon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

functions

A

In order to call a function, we simply write its name (this time without quotes) and end it with a set of parentheses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

String Function Parameter

A

many functions can take instructions, which we call parameters. By sending a string into the function, we can put text on the pop-up box.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Variables

A

Often when programming we want to store values in containers so we can use them later; these are called variables. Let’s store your name in a variable, or ‘var’ for short, by typing the following:

var firstName = “Dorota”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Numbers

A

So far we have only worked with 1 value type (strings), but JavaScript has many! Another example of a value type is a number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Combining Numbers

A

We can also do math in JavaScript! Combine any 2 numbers like so:

14 + 28;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Combining Strings

A

JavaScript not only can combine numbers — it can combine strings as well!

Create an alert that combines both your name and a string, like below:

alert(firstName + “ is awesome!”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly