This is a more detailed list of things we hope you have learned from the JavaScript tutorial. We couldn’t give you this list before you began the tutorial, because some of it would not have made sense to you. Now that you’ve been through the tutorial, it is here to remind you of what you should have learned.
How to use in JavaScript:
+, -, *, /, %>, >=, <, <=, === (is equal to), !== (is not equal to)console.log, confirm, promptVariables:
var name = value;
name = newvalue;if and if/else statements:
if (CONDITION)
{
STATEMENTs
}
and
if (CONDITION)
{
STATEMENTs
}
else
{
STATEMENTs
}How to use in JavaScript:
Defining and calling functions:
var FUNCTION_NAME = function (PARAMETER_NAME) {
STATEMENTs;
};
FUNCTION_NAME(PARAMETER_VALUE);+ as string concatenation: "sheep" + "goat" makes "sheepgoat"return statement.var creates a new variable in the current scope.How to use in JavaScript:
for statements:
for (var COUNTER = START; COUNTER < TOOFAR; COUNTER++)
{
STATEMENTs;
}++, --)+=, -=)myarray[i])for loops to access all elements of an array
myarray.length is the number of elements in the array.\ to continue a string on the next line.mystring[i])How to use in JavaScript:
Repetition with while statements:
while (CONDITION)
{
STATEMENTs;
}while; when to use forRepetition with do/while statements: the loop runs at least once, even if its condition is false at the start.
do
{
STATEMENTs;
}
while (CONDITION);See also Codecademy’s JavaScript Glossary, which is really more of a reference sheet than a glossary. (Parts of the glossary are for topics not assigned for this class.)