Manipulating Data with Expressions Flashcards
(63 cards)
What is an expression?
An expression is any code that resolves to a single value.
Is a string such as ‘hello’ or a number such as 10 considered an expression and why?
the string ‘hello’ and the number ‘10’ are both considered expressions because they are both a single value.
What is an easy way of remembering what an Expression?
“If it produces a value, it’s an expression.”
What do you use in order to perform mathematical calculations within a code?
To perform mathematical calculations within our code, we can use operators.
What is the symbol for the addition operator?
+
What is the symbol for the subtraction operator?
-
What is the symbol for the multiplication operator?
*
What is the symbol for the division operator?
/
What is using operators in order to calculate a result an example of?
Using operators in order to calculate a result is an example of Evaluation.
What is Evaluation?
Evaluation is the process of determining the value of an expression or statement in your code.
What is an Operand?
An Operand is a piece of data used by an Operator.
In the expression - 4 * 25, which are the first and second operands?
4 is the first operand and 25 is the second operand.
What is a Modulo Operator in JavaScript?
The Modulo Operator divides the first operand by the second operand and then evaluates it to a number showing the remainder.
What is the symbol for the Modulo Operator in JS?
The % symbol is used for the Modulo Operator in JS.
Which operator is great for finding out whether numbers are even or odd?
The Modulo Operator is a great operator to find out whether numbers are even or odd.
Using the Modulo Operator, how can you find out whether a number is even or odd?
Even numbers will produce a remainder of 0 when divided by 2 and Odd numbers will produce a remainder of 1 when divided by 2.
What is the symbol for Exponentiation?
The Exponentiation Symbol is **
What does The Exponentiation Operator do?
The Exponentiation Operator Multiplies the First Operand by itself a number of times equal to the Second Operand (the exponent)
What is the Exponent in an Exponentiation Operator?
An Exponent is the Second Operand
Write a code that contains the Exponentiation Operator.
const exponent = 10
const result = 7**exponent
What are ways to express the Exponentiation Operator in Human Language Form?
You can say “ten to the power of seven” or “ten to the seventh power” to express the Exponentiation Operator in Human Language Form.
Which symbol can be used to combine strings together?
The symbol + can be used to combine strings together.
What is a String?
A String is a sequence of characters, used typically to represent text.
What is ‘String Concatenation’?
String Concatenation is using the + operator to combine two Strings together.