Beginner JavaScript Flashcards
JavaScript runs in your web browser alongside HTML and CSS, and can be added to any web page using a _______ tag.
script
What are the three types of JavaScript included in HTML pages?
- ) Internal
- ) External
- ) Inline – Should be avoided
What is the file extension used by JavaScript files?
js
Storing data so we can use it later is achieved with ______.
Variables
var surname = prompt(‘Greetings friend, may I enquire as to your surname?’);
Prompt the user to enter a surname and store the contents of that response in a variable named surname.
What are the two parts to a variable?
The variable’s name and value
What are the two steps to creating a variable?
declaration and initialization
What is the variable declaration?
Declaration is declaring a variable to exist.
What keyword is used to declare a variable?
var
What is Initialization?
Initialization is giving a variable its value for the first time.
What is a string?
A collection of letters. A string is surrounded by single or double quote marks.
What is assignment?
It looks very similar to initialization. You use the equals sign, but there’s no need for the var keyword because we’ve already declared the variable.
What capitalization convention does this variable name use: piecesOfFruit?
Camel casing
Mathematical symbols are called _______.
Operators.
+, -, *, /, %
When a comparison is made the outcome is either true or false; a special kind a of data called a _____. This is _____.
boolean and logic
What operator should be used to find out when two values are equal?
triple equals operator (“===”)
What operator should be used to find out when two values are NOT equal?
triple not equal operator (“!==”)
What operators are used to determine which value greater or less than another?
greater than operator (“>”)
less than operator (“
What operators can be used to determine greater than or equal to? Less than or equal to?
greater than or equal to (“>=”)
less than or equal to operators (“<=”)
______ is used to make decisions in code
Logic created with conditionals